[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241204140547.6epegdjf7i4swsfc@skbuf>
Date: Wed, 4 Dec 2024 16:05:47 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew@...n.ch>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>,
UNGLinuxDriver@...rochip.com,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
Yangbo Lu <yangbo.lu@....com>,
Richard Cochran <richardcochran@...il.com>
Subject: Re: [PATCH net] net: mscc: ocelot: be resilient to loss of PTP
packets during transmission
On Tue, Dec 03, 2024 at 06:47:55PM +0200, Vladimir Oltean wrote:
> @@ -687,10 +743,12 @@ int ocelot_port_txtstamp_request(struct ocelot *ocelot, int port,
> if (!(*clone))
> return -ENOMEM;
>
> - err = ocelot_port_add_txtstamp_skb(ocelot, port, *clone);
> + /* Store timestamp ID in OCELOT_SKB_CB(clone)->ts_id */
> + err = ocelot_port_queue_ptp_tx_skb(ocelot, port, *clone);
> if (err)
> return err;
There was a pre-existing memory leak here.
If ocelot_port_add_txtstamp_skb() fails, we have to undo skb_clone_sk()
using dev_kfree_skb_any(*clone).
If there are no other comments, I'll resend at the 24 hour mark.
pw-bot: cr
>
> + skb_shinfo(*clone)->tx_flags |= SKBTX_IN_PROGRESS;
> OCELOT_SKB_CB(skb)->ptp_cmd = ptp_cmd;
> OCELOT_SKB_CB(*clone)->ptp_class = ptp_class;
> }
Powered by blists - more mailing lists