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

Commit 3c9aaa58 authored by Xiongfeng Wang's avatar Xiongfeng Wang Committed by Greg Kroah-Hartman
Browse files

fbdev: vermilion: decrease reference count in error path



[ Upstream commit 001f2cdb952a9566c77fb4b5470cc361db5601bb ]

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: dbe7e429 ("vmlfb: framebuffer driver for Intel Vermilion Range")
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9413f188
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -277,8 +277,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;
}