From: Maciej Żenczykowski Date: Fri, 6 Sep 2019 03:56:37 +0000 (-0700) Subject: ipv6: addrconf_f6i_alloc - fix non-null pointer check to !IS_ERR() X-Git-Tag: v5.2.16~68 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e33190acd5887ca558837035389ed20aee039c1d;p=users%2Fdwmw2%2Flinux.git ipv6: addrconf_f6i_alloc - fix non-null pointer check to !IS_ERR() [ Upstream commit 8652f17c658d03f5c87b8dee6e8e52480c6cd37d ] Fixes a stupid bug I recently introduced... ip6_route_info_create() returns an ERR_PTR(err) and not a NULL on error. Fixes: d55a2e374a94 ("net-ipv6: fix excessive RTF_ADDRCONF flag on ::1/128 local route (and others)'") Cc: David Ahern Cc: Lorenzo Colitti Cc: Eric Dumazet Signed-off-by: Maciej Żenczykowski Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 97a350041f189..6a6e403c71ac4 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3859,7 +3859,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; }