Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: tag_qca: Make sure there is headroom for tag

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>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Per Forlin and committed by
David S. Miller
04fb9124 5fdcce21

+1 -1
+1 -1
net/dsa/tag_qca.c
··· 33 33 struct dsa_port *dp = dsa_slave_to_port(dev); 34 34 u16 *phdr, hdr; 35 35 36 - if (skb_cow_head(skb, 0) < 0) 36 + if (skb_cow_head(skb, QCA_HDR_LEN) < 0) 37 37 return NULL; 38 38 39 39 skb_push(skb, QCA_HDR_LEN);