Re: [PATCH] samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 7 Dec 2022 15:21:28 +0800
Shang XiaoJing <shangxiaojing@xxxxxxxxxx> wrote:

> Add missing pci_disable_device() in fail path of mdpy_fb_probe().
> 
> Fixes: cacade1946a4 ("sample: vfio mdev display - guest driver")
> Signed-off-by: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
> ---
>  samples/vfio-mdev/mdpy-fb.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
> index 9ec93d90e8a5..a7b3a30058e5 100644
> --- a/samples/vfio-mdev/mdpy-fb.c
> +++ b/samples/vfio-mdev/mdpy-fb.c
> @@ -109,7 +109,7 @@ static int mdpy_fb_probe(struct pci_dev *pdev,
>  
>  	ret = pci_request_regions(pdev, "mdpy-fb");
>  	if (ret < 0)
> -		return ret;
> +		goto err_disable_dev;
>  
>  	pci_read_config_dword(pdev, MDPY_FORMAT_OFFSET, &format);
>  	pci_read_config_dword(pdev, MDPY_WIDTH_OFFSET,	&width);
> @@ -191,6 +191,9 @@ static int mdpy_fb_probe(struct pci_dev *pdev,
>  err_release_regions:
>  	pci_release_regions(pdev);
>  
> +err_disable_dev:
> +	pci_disable_device(pdev);
> +
>  	return ret;
>  }
>  

What about the same in the .remove callback?  Seems that all but the
framebuffer unwind is missing in the remove path.  Thanks,

Alex




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux