Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Xiongfeng Wang and committed by
Helge Deller
001f2cdb b76449ee

+3 -1
+3 -1
drivers/video/fbdev/vermilion/vermilion.c
··· 278 278 279 279 mutex_unlock(&vml_mutex); 280 280 281 - if (pci_enable_device(par->gpu) < 0) 281 + if (pci_enable_device(par->gpu) < 0) { 282 + pci_dev_put(par->gpu); 282 283 return -ENODEV; 284 + } 283 285 284 286 return 0; 285 287 }