Commit 06669e68 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

vrf: fix NULL dereference in vrf_finish_output()

The "skb" pointer is NULL on this error path so we can't dereference it.
Use "dev" instead.

Fixes: 14ee70ca ("vrf: use skb_expand_head in vrf_finish_output")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210806150435.GB15586@kiliSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8fbebef8
......@@ -864,7 +864,7 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s
if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
skb = skb_expand_head(skb, hh_len);
if (!skb) {
skb->dev->stats.tx_errors++;
dev->stats.tx_errors++;
return -ENOMEM;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment