Re: [PATCH net v2 1/3] bus: fsl-mc: Fix potential double device reference in fsl_mc_get_endpoint()
From: Ioana Ciornei
Date: Thu Jul 17 2025 - 09:16:28 EST
On Thu, Jul 17, 2025 at 10:23:07AM +0800, Ma Ke wrote:
> 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@xxxxxxxxxxxxxxx
> Fixes: 1ac210d128ef ("bus: fsl-mc: add the fsl_mc_get_endpoint function")
> Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>
Tested-by: Ioana Ciornei <ioana.ciornei@xxxxxxx>