Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	UNGLinuxDriver@microchip.com,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	Yangbo Lu <yangbo.lu@nxp.com>,
	Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH net] net: mscc: ocelot: be resilient to loss of PTP packets during transmission
Date: Wed, 4 Dec 2024 16:05:47 +0200	[thread overview]
Message-ID: <20241204140547.6epegdjf7i4swsfc@skbuf> (raw)
In-Reply-To: <20241203164755.16115-1-vladimir.oltean@nxp.com> <20241203164755.16115-1-vladimir.oltean@nxp.com>

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;
>  	}

      reply	other threads:[~2024-12-04 14:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 16:47 [PATCH net] net: mscc: ocelot: be resilient to loss of PTP packets during transmission Vladimir Oltean
2024-12-04 14:05 ` Vladimir Oltean [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241204140547.6epegdjf7i4swsfc@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=xiaoliang.yang_1@nxp.com \
    --cc=yangbo.lu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox