diff mbox series

[net,1/2] net: dsa: tag_qca: Make sure there is headroom for tag

Message ID 20200213135100.2963-2-per.forlin@axis.com
State Changes Requested
Delegated to: David Miller
Headers show
Series net: dsa: Make sure there is headroom for tag | expand

Commit Message

Per@axis.com Feb. 13, 2020, 1:50 p.m. UTC
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_qca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Lunn Feb. 13, 2020, 2:01 p.m. UTC | #1
On Thu, Feb 13, 2020 at 02:50:59PM +0100, Per@axis.com wrote:
> 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>

Hi Per

If these are for net, you need a Fixes: tag.

Also, you should add the Reivewed-by: tags i gave for these patches.

      Andrew
Per Förlin Feb. 13, 2020, 3:08 p.m. UTC | #2
> > This change does not introduce any overhead in case there
> > is already available headroom for tag.
> >
> > Signed-off-by: Per Forlin <perfn@axis.com>

> Hi Per

> If these are for net, you need a Fixes: tag.

> Also, you should add the Reivewed-by: tags i gave for these patches.

Yes, I should add this too.
I will post a new series after the weekend with the received Reviewed-by and Tested-by as well.

BR
Per
diff mbox series

Patch

diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index c8a128c9e5e0..70db7c909f74 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -33,7 +33,7 @@  static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct dsa_port *dp = dsa_slave_to_port(dev);
 	u16 *phdr, hdr;
 
-	if (skb_cow_head(skb, 0) < 0)
+	if (skb_cow_head(skb, QCA_HDR_LEN) < 0)
 		return NULL;
 
 	skb_push(skb, QCA_HDR_LEN);