Commit 185e1b1
platform/x86: mlx-platform: call pci_dev_put() to balance the refcount
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: 02daa22 ("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>1 parent 83848e3 commit 185e1b1
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6237 | 6237 | | |
6238 | 6238 | | |
6239 | 6239 | | |
| 6240 | + | |
6240 | 6241 | | |
6241 | 6242 | | |
6242 | 6243 | | |
| |||
6247 | 6248 | | |
6248 | 6249 | | |
6249 | 6250 | | |
| 6251 | + | |
6250 | 6252 | | |
6251 | 6253 | | |
6252 | 6254 | | |
| |||
0 commit comments