]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: mscc: Fix memory leak when using one step timestamping
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Thu, 22 May 2025 11:57:22 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:12 +0000 (11:07 +0100)
commitdb2a12ddd3a31f668137ff6a4befc1343c79cbc4
treecc77593e6be7fcb47c1b828593a2313898ca9fdb
parentd26bb0b3ab2b4d8845e955dc5a22239b665f1ca5
net: phy: mscc: Fix memory leak when using one step timestamping

[ Upstream commit 846992645b25ec4253167e3f931e4597eb84af56 ]

Fix memory leak when running one-step timestamping. When running
one-step sync timestamping, the HW is configured to insert the TX time
into the frame, so there is no reason to keep the skb anymore. As in
this case the HW will never generate an interrupt to say that the frame
was timestamped, then the frame will never released.
Fix this by freeing the frame in case of one-step timestamping.

Fixes: 7d272e63e0979d ("net: phy: mscc: timestamping and PHC support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://patch.msgid.link/20250522115722.2827199-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mscc/mscc_ptp.c