ipv6: Fix addrconf_dst_alloc() failure check.
Subsystems (3)
PATCH 1/1 ipv6: Fix addrconf_dst_alloc() failure check.
The function returns NULL on error and it never return error code embedded in pointer.
--- net/ipv6/addrconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/addrconf.c +2 -2
@@ -783,8 +783,8 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen, } rt =addrconf_dst_alloc (idev, addr, false); -if (IS_ERR (rt)) { - err =PTR_ERR (rt); +if (!rt) { + err = -ENOMEM ; goto out; }
Signature · 1 line
1.7.9.5
Quoted 3 lines · YOSHIFUJI Hideaki
The function returns NULL on error and it never return error code embedded in pointer.
Which functions returns NULL ?
addrconf_dst_alloc() returns ERR_PTR(-ENOMEM) in case of error in my net tree.
Also, please consider adding the bug origin in your changelogs.
Thanks !
Quoted 20 lines
Signed-off-by YOSHIFUJI Hideaki <[email protected]>--- net/ipv6/addrconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/ipv6/addrconf.c +2
-2@@ -783,8 +783,8 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen, } rt =addrconf_dst_alloc (idev, addr, false); -if (IS_ERR (rt)) { - err =PTR_ERR (rt); +if (!rt) { + err = -ENOMEM ; goto out; }
Quoted 11 lines · Eric Dumazet
Quoted 3 lines · YOSHIFUJI Hideaki
The function returns NULL on error and it never return error code embedded in pointer.
Which functions returns NULL ?
addrconf_dst_alloc()returnsERR_PTR(-ENOMEM)in case of error in my net tree.Also, please consider adding the bug origin in your changelogs.
Oh, right. I probably looked into different dst_alloc variants and was confused. Please ignore.
--yoshfuji