* [PATCH net] ipv6: Fix addrconf_dst_alloc() failure check.
@ 2013-01-18 11:56 YOSHIFUJI Hideaki
2013-01-18 14:28 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-18 11:56 UTC (permalink / raw)
To: David Miller, netdev; +Cc: YOSHIFUJI Hideaki
The function returns NULL on error and it never return error code
embedded in pointer.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/addrconf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 420e563..d0a2df2b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -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;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] ipv6: Fix addrconf_dst_alloc() failure check.
2013-01-18 11:56 [PATCH net] ipv6: Fix addrconf_dst_alloc() failure check YOSHIFUJI Hideaki
@ 2013-01-18 14:28 ` Eric Dumazet
2013-01-18 14:38 ` YOSHIFUJI Hideaki
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-01-18 14:28 UTC (permalink / raw)
To: YOSHIFUJI Hideaki; +Cc: David Miller, netdev
On Fri, 2013-01-18 at 20:56 +0900, YOSHIFUJI Hideaki wrote:
> 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 !
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
> net/ipv6/addrconf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 420e563..d0a2df2b 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] ipv6: Fix addrconf_dst_alloc() failure check.
2013-01-18 14:28 ` Eric Dumazet
@ 2013-01-18 14:38 ` YOSHIFUJI Hideaki
0 siblings, 0 replies; 3+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-18 14:38 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev, YOSHIFUJI Hideaki
Eric Dumazet wrote:
> On Fri, 2013-01-18 at 20:56 +0900, YOSHIFUJI Hideaki wrote:
>> 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.
Oh, right. I probably looked into different dst_alloc variants
and was confused. Please ignore.
--yoshfuji
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-18 14:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 11:56 [PATCH net] ipv6: Fix addrconf_dst_alloc() failure check YOSHIFUJI Hideaki
2013-01-18 14:28 ` Eric Dumazet
2013-01-18 14:38 ` YOSHIFUJI Hideaki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).