Re: [PATCH] dpaa2-switch: put MAC endpoint device on disconnect

From: Simon Horman

Date: Wed Jul 15 2026 - 10:29:32 EST


On Wed, Jul 08, 2026 at 07:10:25PM +0800, Guangshuo Li wrote:
> fsl_mc_get_endpoint() returns the MAC endpoint device with a reference
> taken through device_find_child(). The switch port connect path stores
> that device in mac->mc_dev and keeps it for the lifetime of the connected
> MAC object.
>
> However, the disconnect path only closes the MAC and frees the dpaa2_mac
> object. It does not drop the endpoint device reference stored in
> mac->mc_dev, so every successful connect leaks that device reference when
> the MAC is later disconnected.
>
> Drop the endpoint device reference before freeing the dpaa2_mac object.
>
> Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support")
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>