Re: [PATCH] dpaa2-eth: put MAC endpoint device on disconnect
From: Ioana Ciornei
Date: Mon Jul 13 2026 - 08:16:44 EST
On Wed, Jul 08, 2026 at 07:17:37PM +0800, Guangshuo Li wrote:
> fsl_mc_get_endpoint() returns the MAC endpoint device with a reference
> taken through device_find_child(). The Ethernet 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 disconnects and closes the MAC before
> freeing 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 after closing the MAC and before
> freeing the dpaa2_mac object.
>
> Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink")
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
Reviewed-by: Ioana Ciornei <ioana.ciornei@xxxxxxx>