All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Per@axis.com>, <"Forlin <per.forlin"@axis.com>
To: <netdev@vger.kernel.org>, <andrew@lunn.ch>,
	<o.rempel@pengutronix.de>, <davem@davemloft.net>
Cc: Per Forlin <per.forlin@axis.com>, Per Forlin <perfn@axis.com>
Subject: [PATCH net 2/2] net: dsa: tag_ar9331: Make sure there is headroom for tag
Date: Thu, 13 Feb 2020 14:51:00 +0100	[thread overview]
Message-ID: <20200213135100.2963-3-per.forlin@axis.com> (raw)
In-Reply-To: <20200213135100.2963-1-per.forlin@axis.com>

From: Per Forlin <per.forlin@axis.com>

Passing tag size to skb_cow_head will make sure
there is enough headroom for the tag data.
This change does not introduce any overhead in case there
is already available headroom for tag.

Signed-off-by: Per Forlin <perfn@axis.com>
---
 net/dsa/tag_ar9331.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/tag_ar9331.c b/net/dsa/tag_ar9331.c
index 466ffa92a474..55b00694cdba 100644
--- a/net/dsa/tag_ar9331.c
+++ b/net/dsa/tag_ar9331.c
@@ -31,7 +31,7 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb,
 	__le16 *phdr;
 	u16 hdr;
 
-	if (skb_cow_head(skb, 0) < 0)
+	if (skb_cow_head(skb, AR9331_HDR_LEN) < 0)
 		return NULL;
 
 	phdr = skb_push(skb, AR9331_HDR_LEN);
-- 
2.11.0


  parent reply	other threads:[~2020-02-13 13:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 13:50 [PATCH net 0/2] net: dsa: Make sure there is headroom for tag Per, Forlin <per.forlin
2020-02-13 13:50 ` [PATCH net 1/2] net: dsa: tag_qca: " Per, Forlin <per.forlin
2020-02-13 14:01   ` Andrew Lunn
2020-02-13 15:08     ` Per Förlin
2020-02-13 13:51 ` Per, Forlin <per.forlin [this message]
2020-02-13 13:59   ` [PATCH net 2/2] net: dsa: tag_ar9331: " Oleksij Rempel
2020-02-13 14:42     ` Per Förlin
2020-02-13 14:26   ` David Miller
2020-02-13 14:37 [PATCH net 0/2] net: dsa: " Per Forlin
2020-02-13 14:37 ` [PATCH net 2/2] net: dsa: tag_ar9331: " Per Forlin
2020-02-13 20:02   ` Florian Fainelli

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=20200213135100.2963-3-per.forlin@axis.com \
    --to=per@axis.com \
    --cc="Forlin <per.forlin"@axis.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=per.forlin@axis.com \
    --cc=perfn@axis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.