Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65dbd8ee authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

fbdev: pm2fb: fix missing pci_disable_device()



[ Upstream commit ed359a464846b48f76ea6cc5cd8257e545ac97f4 ]

Add missing pci_disable_device() in error path of probe() and remove() path.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 77738055
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1529,8 +1529,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) {
@@ -1711,6 +1713,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;
}

@@ -1737,6 +1741,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[] = {