Re: [PATCH net v2] phy: mscc: Fix timestamping for vsc8584

From: Paolo Abeni
Date: Tue Aug 12 2025 - 05:56:27 EST


On 8/6/25 7:46 AM, Horatiu Vultur wrote:
> @@ -1567,6 +1592,7 @@ int vsc8584_ptp_probe(struct phy_device *phydev)
>
> mutex_init(&vsc8531->phc_lock);
> mutex_init(&vsc8531->ts_lock);
> + skb_queue_head_init(&vsc8531->rx_skbs_list);

The aux work is cancelled by ptp_clock_unregister(), meaning the
`rx_skbs_list` could be left untouched if the unreg happens while the
work is scheduled but not running yet, casing memory leaks.

It's not obvious to me where/how ptp_clock_unregister() is called, as
AFAICS the vsc85xxx phy driver lacks the 'remove' op. In any case I
think you need to explicitly flushing the rx_skbs_list list on removal.

Thanks,

Paolo