Re: [PATCH net v2] phy: mscc: Fix timestamping for vsc8584
From: Horatiu Vultur
Date: Wed Aug 13 2025 - 02:46:03 EST
The 08/12/2025 11:55, Paolo Abeni wrote:
Hi Paolo,
>
> 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.
Yes, I will flush the rx_skbs_list on removal.
I will look also to see where/how ptp_clock_unregister() is called, but
this will be in a different patch if it is an issue.
>
> Thanks,
>
> Paolo
>
--
/Horatiu