Skip to content

Commit

Permalink
ipv6: addrconf_f6i_alloc - fix non-null pointer check to !IS_ERR()
Browse files Browse the repository at this point in the history
Fixes a stupid bug I recently introduced...
ip6_route_info_create() returns an ERR_PTR(err) and not a NULL on error.

Fixes: d55a2e3 ("net-ipv6: fix excessive RTF_ADDRCONF flag on ::1/128 local route (and others)'")
Cc: David Ahern <[email protected]>
Cc: Lorenzo Colitti <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: Maciej Żenczykowski <[email protected]>
Reported-by: syzbot <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
zenczykowski authored and davem330 committed Sep 7, 2019
1 parent fe163e5 commit 8652f17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -4406,7 +4406,7 @@ struct fib6_info *addrconf_f6i_alloc(struct net *net,
}

f6i = ip6_route_info_create(&cfg, gfp_flags, NULL);
if (f6i)
if (!IS_ERR(f6i))
f6i->dst_nocount = true;
return f6i;
}
Expand Down

0 comments on commit 8652f17

Please sign in to comment.