Skip to content

Commit 001f2cd

Browse files
fenghusthuhdeller
authored andcommitted
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: dbe7e42 ("vmlfb: framebuffer driver for Intel Vermilion Range") Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent b76449e commit 001f2cd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/video/fbdev/vermilion/vermilion.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ static int vmlfb_get_gpu(struct vml_par *par)
278278

279279
mutex_unlock(&vml_mutex);
280280

281-
if (pci_enable_device(par->gpu) < 0)
281+
if (pci_enable_device(par->gpu) < 0) {
282+
pci_dev_put(par->gpu);
282283
return -ENODEV;
284+
}
283285

284286
return 0;
285287
}

0 commit comments

Comments
 (0)