]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 18 Nov 2022 09:33:03 +0000 (17:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:03 +0000 (11:23 +0100)
commit10638af508a2d4ceab865373fcb49a22c62c6590
tree5fc455595dc5fcdd9d3f89687cac54457a820561
parent9e578def3e6b049a340d5bfe96fd0fe737bc7b17
hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new()

[ Upstream commit 7dec14537c5906b8bf40fd6fd6d9c3850f8df11d ]

As comment of pci_get_domain_bus_and_slot() says, it returns
a pci device with refcount increment, when finish using it,
the caller must decrement the reference count by calling
pci_dev_put(). So call it after using to avoid refcount leak.

Fixes: 6d503ea9540b ("hwmon: (coretemp) Use PCI host bridge ID to identify CPU if necessary")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221118093303.214163-1-yangyingliang@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/coretemp.c