]> git.ipfire.org Git - thirdparty/linux.git/commit
dpaa2-eth: put MAC endpoint device on disconnect
authorGuangshuo Li <lgs201920130244@gmail.com>
Wed, 8 Jul 2026 11:17:37 +0000 (19:17 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 21 Jul 2026 10:23:04 +0000 (12:23 +0200)
commitb4b201cc93ff70150853aba03e14d314d1980ca0
treec60b6a5ced98f1d2e4660a7edd803a472fdd3031
parent2484568a335cd7bda951c75b3a7d95ea36161ae7
dpaa2-eth: put MAC endpoint device on disconnect

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@gmail.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://patch.msgid.link/20260708111738.750391-1-lgs201920130244@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c