net: dpaa2: ptp: fix device node reference leak on remove

dpaa2_ptp_probe() gets a referenced device node with
of_find_compatible_node() and stores it in dev->of_node.

The probe failure paths release this reference with of_node_put().
However, after a successful probe, dpaa2_ptp_remove() tears down the
PTP and MC resources without dropping the device node reference.

Release dev->of_node during driver removal and clear the pointer after
dropping the reference.

This issue was found by manual code inspection.

Cc: stable+noautosel@kernel.org # untested fix to a driver init path
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260916030015.2818545-1-lgs201920130244@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Guangshuo Li 2026-09-16 11:00:15 +08:00 • committed by Jakub Kicinski
commit 9211c455de