summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorXiongfeng Wang <wangxiongfeng2@huawei.com>2022-11-14 09:56:54 +0100
committerHelge Deller <deller@gmx.de>2022-12-14 20:01:50 +0100
commit001f2cdb952a9566c77fb4b5470cc361db5601bb (patch)
treef623ada289dfb08bc4e1e135af5a5d24fe2d6933 /drivers/video
parentfbdev: smscufx: fix error handling code in ufx_usb_probe (diff)
downloadlinux-001f2cdb952a9566c77fb4b5470cc361db5601bb.tar.xz
linux-001f2cdb952a9566c77fb4b5470cc361db5601bb.zip
fbdev: vermilion: decrease reference count in error path
pci_get_device() will increase the reference count for the returned pci_dev. For the error path, we need to use pci_dev_put() to decrease the reference count. Fixes: dbe7e429fedb ("vmlfb: framebuffer driver for Intel Vermilion Range") Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/vermilion/vermilion.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c
index 1465fb7b619e..0374ee6b6d03 100644
--- a/drivers/video/fbdev/vermilion/vermilion.c
+++ b/drivers/video/fbdev/vermilion/vermilion.c
@@ -278,8 +278,10 @@ static int vmlfb_get_gpu(struct vml_par *par)
mutex_unlock(&vml_mutex);
- if (pci_enable_device(par->gpu) < 0)
+ if (pci_enable_device(par->gpu) < 0) {
+ pci_dev_put(par->gpu);
return -ENODEV;
+ }
return 0;
}