]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ipv6: addrconf_f6i_alloc - fix non-null pointer check to !IS_ERR()
authorMaciej Żenczykowski <maze@google.com>
Fri, 6 Sep 2019 03:56:37 +0000 (20:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 07:10:49 +0000 (09:10 +0200)
[ 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 <dsahern@gmail.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/route.c

index 97a350041f1899e6469c8b44898167ea36dd1935..6a6e403c71ac4bd0bbe760568520c6c6ce8af3bd 100644 (file)
@@ -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;
 }