EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 28 Nov 2022 06:55:12 +0000 (14:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:03 +0000 (13:14 +0100)
commit3e255dc21031cc1f341584eb99a7f31598bf0be7
tree8e8e6a10d994e71b5e13cbfb4dd2c38dae9940c7
parent740efb64ca5e8f2b30ac843bc4ab07950479fed4
EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()

[ Upstream commit 9c8921555907f4d723f01ed2d859b66f2d14f08e ]

As the comment of pci_get_domain_bus_and_slot() says, it returns
a PCI device with refcount incremented, so it doesn't need to
call an extra pci_dev_get() in pci_get_dev_wrapper(), and the PCI
device needs to be put in the error path.

Fixes: d4dc89d069aa ("EDAC, i10nm: Add a driver for Intel 10nm server processors")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20221128065512.3572550-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/edac/i10nm_base.c