mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
Add missing pci_disable_device() in fail path of mdpy_fb_probe().
Besides, fix missing release functions in mdpy_fb_remove().
Fixes: cacade1946
("sample: vfio mdev display - guest driver")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20221208013341.3999-1-shangxiaojing@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
f2240b4441
commit
d1f0f50fbb
@ -109,7 +109,7 @@ static int mdpy_fb_probe(struct pci_dev *pdev,
|
|||||||
|
|
||||||
ret = pci_request_regions(pdev, "mdpy-fb");
|
ret = pci_request_regions(pdev, "mdpy-fb");
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto err_disable_dev;
|
||||||
|
|
||||||
pci_read_config_dword(pdev, MDPY_FORMAT_OFFSET, &format);
|
pci_read_config_dword(pdev, MDPY_FORMAT_OFFSET, &format);
|
||||||
pci_read_config_dword(pdev, MDPY_WIDTH_OFFSET, &width);
|
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:
|
err_release_regions:
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
|
|
||||||
|
err_disable_dev:
|
||||||
|
pci_disable_device(pdev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +202,10 @@ static void mdpy_fb_remove(struct pci_dev *pdev)
|
|||||||
struct fb_info *info = pci_get_drvdata(pdev);
|
struct fb_info *info = pci_get_drvdata(pdev);
|
||||||
|
|
||||||
unregister_framebuffer(info);
|
unregister_framebuffer(info);
|
||||||
|
iounmap(info->screen_base);
|
||||||
framebuffer_release(info);
|
framebuffer_release(info);
|
||||||
|
pci_release_regions(pdev);
|
||||||
|
pci_disable_device(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pci_device_id mdpy_fb_pci_table[] = {
|
static struct pci_device_id mdpy_fb_pci_table[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user