Skip to content

Commit ed359a4

Browse files
Yang Yinglianghdeller
authored andcommitted
fbdev: pm2fb: fix missing pci_disable_device()
Add missing pci_disable_device() in error path of probe() and remove() path. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent eceadc9 commit ed359a4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/video/fbdev/pm2fb.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,10 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
15331533
}
15341534

15351535
info = framebuffer_alloc(sizeof(struct pm2fb_par), &pdev->dev);
1536-
if (!info)
1537-
return -ENOMEM;
1536+
if (!info) {
1537+
err = -ENOMEM;
1538+
goto err_exit_disable;
1539+
}
15381540
default_par = info->par;
15391541

15401542
switch (pdev->device) {
@@ -1715,6 +1717,8 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17151717
release_mem_region(pm2fb_fix.mmio_start, pm2fb_fix.mmio_len);
17161718
err_exit_neither:
17171719
framebuffer_release(info);
1720+
err_exit_disable:
1721+
pci_disable_device(pdev);
17181722
return retval;
17191723
}
17201724

@@ -1739,6 +1743,7 @@ static void pm2fb_remove(struct pci_dev *pdev)
17391743
fb_dealloc_cmap(&info->cmap);
17401744
kfree(info->pixmap.addr);
17411745
framebuffer_release(info);
1746+
pci_disable_device(pdev);
17421747
}
17431748

17441749
static const struct pci_device_id pm2fb_id_table[] = {

0 commit comments

Comments
 (0)