Patch "samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()" has been added to the 6.0-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     samples-vfio-mdev-fix-missing-pci_disable_device-in-.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 951410666795f072f474f99c10eb6966a17b893a
Author: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
Date:   Thu Dec 8 09:33:41 2022 +0800

    samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
    
    [ Upstream commit d1f0f50fbbbbca1e3e8157e51934613bf88f6d44 ]
    
    Add missing pci_disable_device() in fail path of mdpy_fb_probe().
    Besides, fix missing release functions in mdpy_fb_remove().
    
    Fixes: cacade1946a4 ("sample: vfio mdev display - guest driver")
    Signed-off-by: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221208013341.3999-1-shangxiaojing@xxxxxxxxxx
    Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
index 9ec93d90e8a5..4eb7aa11cfbb 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;
 }
 
@@ -199,7 +202,10 @@ static void mdpy_fb_remove(struct pci_dev *pdev)
 	struct fb_info *info = pci_get_drvdata(pdev);
 
 	unregister_framebuffer(info);
+	iounmap(info->screen_base);
 	framebuffer_release(info);
+	pci_release_regions(pdev);
+	pci_disable_device(pdev);
 }
 
 static struct pci_device_id mdpy_fb_pci_table[] = {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux