Netdev List
 help / color / mirror / Atom feed
From: Qingfang Deng <qingfang.deng@linux.dev>
To: Linus Walleij <linusw@kernel.org>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com,
	"Chester A. Unal" <chester.a.unal@arinc9.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Wei Fang" <wei.fang@nxp.com>,
	"Clark Wang" <xiaoning.wang@nxp.com>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"George McCollister" <george.mccollister@gmail.com>,
	"David Yang" <mmyangfl@gmail.com>,
	netdev@vger.kernel.org,
	"Sashiko AI Review" <sashiko-bot@kernel.org>
Subject: Re: [PATCH net-next v2] net: dsa: Fix skb ownership in taggers
Date: Wed, 17 Jun 2026 10:22:47 +0800	[thread overview]
Message-ID: <20260617022248.1500-1-qingfang.deng@linux.dev> (raw)
In-Reply-To: <20260616-dsa-fix-free-skb-v2-1-9dbda6a19e97@kernel.org>

On 16 Jun 2026 at 11:36:22 +0200, Linus Walleij wrote:
> --- a/net/dsa/tag_rtl4_a.c
> +++ b/net/dsa/tag_rtl4_a.c
> @@ -41,8 +41,10 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb,
>  	u16 out;
>  
>  	/* Pad out to at least 60 bytes */
> -	if (unlikely(__skb_put_padto(skb, ETH_ZLEN, false)))
> +	if (unlikely(__skb_put_padto(skb, ETH_ZLEN, false))) {
> +		kfree_skb(skb);
>  		return NULL;
> +	}

This can be simplified to eth_skb_pad().

>  
>  	netdev_dbg(dev, "add realtek tag to package to port %d\n",
>  		   dp->index);
> --- a/net/dsa/tag_rzn1_a5psw.c
> +++ b/net/dsa/tag_rzn1_a5psw.c
> @@ -48,7 +48,7 @@ static struct sk_buff *a5psw_tag_xmit(struct sk_buff *skb, struct net_device *de
>  	 * least 60 bytes otherwise they will be discarded when they enter the
>  	 * switch port logic.
>  	 */
> -	if (__skb_put_padto(skb, ETH_ZLEN, false))
> +	if (skb_put_padto(skb, ETH_ZLEN))
>  		return NULL;

Same here.

>  
>  	/* provide 'A5PSW_TAG_LEN' bytes additional space */

- Qingfang

      parent reply	other threads:[~2026-06-17  2:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16  9:36 [PATCH net-next v2] net: dsa: Fix skb ownership in taggers Linus Walleij
2026-06-16 10:19 ` Wei Fang
2026-06-16 21:37 ` Vladimir Oltean
2026-06-17  2:22 ` Qingfang Deng [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=20260617022248.1500-1-qingfang.deng@linux.dev \
    --to=qingfang.deng@linux.dev \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chester.a.unal@arinc9.com \
    --cc=clement.leger@bootlin.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=george.mccollister@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=horms@kernel.org \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linusw@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sashiko-bot@kernel.org \
    --cc=wei.fang@nxp.com \
    --cc=woojung.huh@microchip.com \
    --cc=xiaoning.wang@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