mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	drm/hyperv: Fix an error handling path in hyperv_vmbus_probe()
hyperv_setup_vram() calls vmbus_allocate_mmio(). This must be undone in
the error handling path of the probe, as already done in the remove
function.
Fixes: a0ab5abced ("drm/hyperv : Removing the restruction of VRAM allocation with PCI bar size")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/7dfa372af3e35fbb1d6f157183dfef2e4512d3be.1659297696.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Wei Liu <wei.liu@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									568035b01c
								
							
						
					
					
						commit
						f1f63cbb70
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -133,7 +133,6 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	ret = hyperv_setup_vram(hv, hdev);
 | 
			
		||||
 | 
			
		||||
	if (ret)
 | 
			
		||||
		goto err_vmbus_close;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -150,18 +149,20 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
 | 
			
		|||
 | 
			
		||||
	ret = hyperv_mode_config_init(hv);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		goto err_vmbus_close;
 | 
			
		||||
		goto err_free_mmio;
 | 
			
		||||
 | 
			
		||||
	ret = drm_dev_register(dev, 0);
 | 
			
		||||
	if (ret) {
 | 
			
		||||
		drm_err(dev, "Failed to register drm driver.\n");
 | 
			
		||||
		goto err_vmbus_close;
 | 
			
		||||
		goto err_free_mmio;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	drm_fbdev_generic_setup(dev, 0);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
 | 
			
		||||
err_free_mmio:
 | 
			
		||||
	vmbus_free_mmio(hv->mem->start, hv->fb_size);
 | 
			
		||||
err_vmbus_close:
 | 
			
		||||
	vmbus_close(hdev->channel);
 | 
			
		||||
err_hv_set_drv_data:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue