summaryrefslogtreecommitdiff
path: root/drivers/net/vrf.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-08-06 18:04:35 +0300
committerJakub Kicinski <kuba@kernel.org>2021-08-07 01:40:37 +0300
commit06669e6880be7422bb9926f71be39c4924b92fea (patch)
tree2e1609e8910e8d3478874791848d49c42f6bf39e /drivers/net/vrf.c
parent8fbebef80107d779b8e356cf60323454a4099d76 (diff)
downloadlinux-06669e6880be7422bb9926f71be39c4924b92fea.tar.xz
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: 14ee70ca89e6 ("vrf: use skb_expand_head in vrf_finish_output") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20210806150435.GB15586@kili Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r--drivers/net/vrf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 726adf07ef31..662e26117353 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -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;
}
}