linux-loongson/drivers/bus/fsl-mc
Ma Ke bddbe13d36 bus: fsl-mc: Fix potential double device reference in fsl_mc_get_endpoint()
The fsl_mc_get_endpoint() function may call fsl_mc_device_lookup()
twice, which would increment the device's reference count twice if
both lookups find a device. This could lead to a reference count leak.

Found by code review.

Cc: stable@vger.kernel.org
Fixes: 1ac210d128 ("bus: fsl-mc: add the fsl_mc_get_endpoint function")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: 8567494ceb ("bus: fsl-mc: rescan devices if endpoint not found")
Link: https://patch.msgid.link/20250717022309.3339976-1-make24@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-18 17:13:50 -07:00
..
dpbp.c bus: fsl-mc: remove duplicated include files 2018-12-06 15:53:20 +01:00
dpcon.c bus: fsl-mc: remove duplicated include files 2018-12-06 15:53:20 +01:00
dpmcp.c bus: fsl-mc: Remove deadcode 2025-03-21 09:46:08 +01:00
dprc-driver.c bus: fsl-mc: drop useless cleanup 2025-05-13 01:34:57 +02:00
dprc.c bus: fsl-mc: Use strscpy() instead of strscpy_pad() 2025-05-13 01:39:01 +02:00
fsl-mc-allocator.c bus: fsl-mc: drop useless cleanup 2025-05-13 01:34:57 +02:00
fsl-mc-bus.c bus: fsl-mc: Fix potential double device reference in fsl_mc_get_endpoint() 2025-07-18 17:13:50 -07:00
fsl-mc-msi.c bus: Explicitly include correct DT includes 2023-08-12 10:31:01 +02:00
fsl-mc-private.h bus: fsl-mc: drop useless cleanup 2025-05-13 01:34:57 +02:00
fsl-mc-uapi.c bus: fsl-mc: add the dprc_get_mem() command to the whitelist 2025-05-13 01:34:57 +02:00
Kconfig genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
Makefile bus/fsl-mc: Add generic implementation for open/reset/close commands 2021-09-28 16:56:05 -06:00
mc-io.c bus: fsl-mc: do not add a device-link for the UAPI used DPMCP device 2025-05-13 01:34:57 +02:00
mc-sys.c bus: fsl-mc: increase MC_CMD_COMPLETION_TIMEOUT_MS value 2025-05-13 01:34:57 +02:00
obj-api.c bus/fsl-mc: Add generic implementation for open/reset/close commands 2021-09-28 16:56:05 -06:00