Skip to content

Commit

Permalink
fbdev: vermilion: decrease reference count in error path
Browse files Browse the repository at this point in the history
[ Upstream commit 001f2cd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
fenghusthu authored and gregkh committed Dec 31, 2022
1 parent e94ae43 commit 1fb436d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/fbdev/vermilion/vermilion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1fb436d

Please sign in to comment.