Commit 83f64bb3 authored by Ma Ke's avatar Ma Ke Committed by Greg Kroah-Hartman
Browse files

bus: fsl-mc: Fix potential double device reference in fsl_mc_get_endpoint()



commit bddbe13d upstream.

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: 1ac210d1 ("bus: fsl-mc: add the fsl_mc_get_endpoint function")
Signed-off-by: default avatarMa Ke <make24@iscas.ac.cn>
Tested-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Fixes: 8567494c ("bus: fsl-mc: rescan devices if endpoint not found")
Link: https://patch.msgid.link/20250717022309.3339976-1-make24@iscas.ac.cn


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c742b063
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment