]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: fix dereference of rt6_ex before null check error
authorColin Ian King <colin.king@canonical.com>
Tue, 10 Oct 2017 17:01:16 +0000 (18:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Oct 2017 17:54:17 +0000 (10:54 -0700)
commit0889d980ee7be3473218bde09ff5600a6fe663b5
tree498341271f337447255fc04dac899aa98056f936
parent853e46656cf5ec4a9718e51b1d37cff26455e3cc
ipv6: fix dereference of rt6_ex before null check error

Currently rt6_ex is being dereferenced before it is null checked
hence there is a possible null dereference bug. Fix this by only
dereferencing rt6_ex after it has been null checked.

Detected by CoverityScan, CID#1457749 ("Dereference before null check")

Fixes: 7e71c3a9eff0 ("ipv6: take care of rt6_stats")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c