Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: DENG Qingfang <dqfext@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Mauri Sandberg <sandberg@mailfence.com>
Subject: Re: [PATCH] net: dsa: tag_rtl4_a: Support also egress tags
Date: Wed, 17 Feb 2021 14:42:39 +0200	[thread overview]
Message-ID: <20210217124239.sxgkhow53vox7o54@skbuf> (raw)
In-Reply-To: <CALW65jbEjWtb3ww=Bq5WKrjpQ=fjrxCBKyxxxi0CGRAVAkdO7g@mail.gmail.com>

On Wed, Feb 17, 2021 at 08:38:30PM +0800, DENG Qingfang wrote:
> On Wed, Feb 17, 2021 at 7:55 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> > +
> > +       /* Pad out to at least 60 bytes */
> > +       if (unlikely(eth_skb_pad(skb)))
> > +               return NULL;
>
> I just found that this will cause double free (eth_skb_pad will free
> the skb if allocation fails, and dsa_slave_xmit will still try to free
> it because it returns NULL.
> Replace eth_skb_pad(skb) with __skb_put_padto(skb, ETH_ZLEN, false) to
> avoid that.

Good catch, Qingfang.

  reply	other threads:[~2021-02-17 12:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 23:55 [PATCH] net: dsa: tag_rtl4_a: Support also egress tags Linus Walleij
2021-02-17  1:00 ` patchwork-bot+netdevbpf
2021-02-17  1:04   ` Florian Fainelli
2021-02-17  3:29 ` Andrew Lunn
2021-02-17  5:37   ` DENG Qingfang
2021-02-17 11:41     ` Vladimir Oltean
2021-02-17  5:40 ` DENG Qingfang
2021-02-17 11:33 ` Vladimir Oltean
2021-02-17 12:38 ` DENG Qingfang
2021-02-17 12:42   ` Vladimir Oltean [this message]
2021-02-17 14:19     ` Heiner Kallweit

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=20210217124239.sxgkhow53vox7o54@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=sandberg@mailfence.com \
    --cc=vivien.didelot@gmail.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