samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
Subsystems (2)
PATCH 1/1 samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
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 <[email protected]>
--- samples/vfio-mdev/mdpy-fb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
samples/vfio-mdev/mdpy-fb.c +4 -1
@@ -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; }
Signature · 1 line
2.17.1
Quoted 22 lines · On Wed, 7 Dec 2022 15:21:28 +0800 Shang XiaoJing <[email protected]>…
Add missing
pci_disable_device()in fail path ofmdpy_fb_probe().Fixes cacade1946a4 ("sample: vfio mdev display - guest driver")Signed-off-by Shang XiaoJing <[email protected]>--- samples/vfio-mdev/mdpy-fb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -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);
samples/vfio-mdev/mdpy-fb.c static int mdpy_fb_probe(struct pci_dev *pdev, · line 199
Quoted 9 lines
samples/vfio-mdev/mdpy-fb.c +3
-0@@ -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
Quoted 28 lines · Alex Williamson
Quoted 25 lines · On Wed, 7 Dec 2022 15:21:28 +0800 Shang XiaoJing <[email protected]>…
Add missing
pci_disable_device()in fail path ofmdpy_fb_probe().Fixes cacade1946a4 ("sample: vfio mdev display - guest driver")Signed-off-by Shang XiaoJing <[email protected]>--- samples/vfio-mdev/mdpy-fb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)samples/vfio-mdev/mdpy-fb.c +1
-1@@ -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);
Quoted 10 lines
samples/vfio-mdev/mdpy-fb.c static int mdpy_fb_probe(struct pci_dev *pdev, · line 199
Quoted 6 lines
samples/vfio-mdev/mdpy-fb.c +3
-0+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,
Right, will fix in v2.
Thanks for the review,
Signature · 1 line
Shang XiaoJing