Skip to content

Commit

Permalink
fbdev: pm2fb: fix missing pci_disable_device()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yang Yingliang authored and hdeller committed Dec 14, 2022
1 parent eceadc9 commit ed359a4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/video/fbdev/pm2fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,8 +1533,10 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
}

info = framebuffer_alloc(sizeof(struct pm2fb_par), &pdev->dev);
if (!info)
return -ENOMEM;
if (!info) {
err = -ENOMEM;
goto err_exit_disable;
}
default_par = info->par;

switch (pdev->device) {
Expand Down Expand Up @@ -1715,6 +1717,8 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
release_mem_region(pm2fb_fix.mmio_start, pm2fb_fix.mmio_len);
err_exit_neither:
framebuffer_release(info);
err_exit_disable:
pci_disable_device(pdev);
return retval;
}

Expand All @@ -1739,6 +1743,7 @@ static void pm2fb_remove(struct pci_dev *pdev)
fb_dealloc_cmap(&info->cmap);
kfree(info->pixmap.addr);
framebuffer_release(info);
pci_disable_device(pdev);
}

static const struct pci_device_id pm2fb_id_table[] = {
Expand Down

0 comments on commit ed359a4

Please sign in to comment.