net/ipv6: Fix a test against 'ipv6_find_idev()' return value
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 28 Dec 2018 22:28:21 +0000 (23:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:38:35 +0000 (17:38 +0100)
commitfe3f820c18b01b8a5fc3ae220ad7d0d0d4ee7a8d
tree8570f1d29150e25d73ee91fbbdd208e85d82549d
parent5ac4cc331bca6c759460fc948d19906f4f7f5831
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>
net/ipv6/addrconf.c