diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2018-12-28 23:28:21 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-09 17:38:35 +0100 |
commit | fe3f820c18b01b8a5fc3ae220ad7d0d0d4ee7a8d (patch) | |
tree | 8570f1d29150e25d73ee91fbbdd208e85d82549d /net/ipv6/addrconf.c | |
parent | 5ac4cc331bca6c759460fc948d19906f4f7f5831 (diff) | |
download | talos-obmc-linux-fe3f820c18b01b8a5fc3ae220ad7d0d0d4ee7a8d.tar.gz talos-obmc-linux-fe3f820c18b01b8a5fc3ae220ad7d0d0d4ee7a8d.zip |
net/ipv6: Fix a test against 'ipv6_find_idev()' return value
[ Upstream commit 178fe94405bffbd1acd83b6ff3b40211185ae9c9 ]
'ipv6_find_idev()' returns NULL on error, not an error pointer.
Update the test accordingly and return -ENOBUFS, as already done in
'addrconf_add_dev()', if NULL is returned.
Fixes: ("ipv6: allow userspace to add IFA_F_OPTIMISTIC addresses")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 4e81ff2f4588..3dfc50cd86d6 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4711,8 +4711,8 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, IFA_F_MCAUTOJOIN | IFA_F_OPTIMISTIC; idev = ipv6_find_idev(dev); - if (IS_ERR(idev)) - return PTR_ERR(idev); + if (!idev) + return -ENOBUFS; if (!ipv6_allow_optimistic_dad(net, idev)) cfg.ifa_flags &= ~IFA_F_OPTIMISTIC; |