Skip to content

Commit

Permalink
net/ipv6: Remove unncessary check on f6i in fib6_check
Browse files Browse the repository at this point in the history
Dan reported an imbalance in fib6_check on use of f6i and checking
whether it is null. Since fib6_check is only called if f6i is non-null,
remove the unnecessary check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Ahern authored and David S. Miller committed Apr 21, 2018
1 parent a68886a commit 8ae8697
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2130,8 +2130,7 @@ static bool fib6_check(struct fib6_info *f6i, u32 cookie)
{
u32 rt_cookie = 0;

if ((f6i && !fib6_get_cookie_safe(f6i, &rt_cookie)) ||
rt_cookie != cookie)
if (!fib6_get_cookie_safe(f6i, &rt_cookie) || rt_cookie != cookie)
return false;

if (fib6_check_expired(f6i))
Expand Down

0 comments on commit 8ae8697

Please sign in to comment.