twx-linux/drivers/platform
Joe Hattori 23ea763880 platform/x86: mlx-platform: call pci_dev_put() to balance the refcount
[ Upstream commit 185e1b1d91e419445d3fd99c1c0376a970438acf ]

mlxplat_pci_fpga_device_init() calls pci_get_device() but does not
release the refcount on error path. Call pci_dev_put() on the error path
and in mlxplat_pci_fpga_device_exit() to fix this.

This bug was found by an experimental static analysis tool that I am
developing.

Fixes: 02daa222fbdd ("platform: mellanox: Add initial support for PCIe based programming logic device")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20241216022538.381209-1-joe@pf.is.s.u-tokyo.ac.jp
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-09 13:31:53 +01:00
..
chrome platform/chrome: cros_ec_typec: fix missing fwnode reference decrement 2024-12-09 10:32:48 +01:00
goldfish
loongarch
mellanox platform/mellanox: nvsw-sn2201: Add check for platform_device_add_resources 2024-07-25 09:50:51 +02:00
mips platform: mips: cpu_hwmon: Disable driver on unsupported hardware 2024-08-03 08:54:30 +02:00
olpc
surface platform/surface: aggregator_registry: Add support for Surface Laptop Go 3 2024-09-18 19:24:06 +02:00
x86 platform/x86: mlx-platform: call pci_dev_put() to balance the refcount 2025-01-09 13:31:53 +01:00
Kconfig
Makefile