[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4oylx2qkf3aagntqhmmmse74l3hjolylf3hgjym7l6motnbmlp@mpjsoobpec25>
Date: Thu, 17 Jul 2025 16:23:20 +0300
From: Ioana Ciornei <ioana.ciornei@....com>
To: Ma Ke <make24@...as.ac.cn>
Cc: davem@...emloft.net, andrew+netdev@...n.ch, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, horms@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org, stable@...r.kernel.org
Subject: Re: [PATCH net v2 3/3] dpaa2-switch: Fix device reference count leak
in MAC endpoint handling
On Thu, Jul 17, 2025 at 10:23:09AM +0800, Ma Ke wrote:
> The fsl_mc_get_endpoint() function uses device_find_child() for
> localization, which implicitly calls get_device() to increment the
> device's reference count before returning the pointer. However, the
> caller dpaa2_switch_port_connect_mac() fails to properly release this
> reference in multiple scenarios. We should call put_device() to
> decrement reference count properly.
>
> As comment of device_find_child() says, 'NOTE: you will need to drop
> the reference with put_device() after use'.
>
> Found by code review.
>
> Cc: stable@...r.kernel.org
> Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support")
> Signed-off-by: Ma Ke <make24@...as.ac.cn>
Tested-by: Ioana Ciornei <ioana.ciornei@....com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@....com>
Powered by blists - more mailing lists