* [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
@ 2004-10-19 22:13 Patrick McHardy
2004-10-20 6:35 ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-21 5:17 ` David S. Miller
0 siblings, 2 replies; 4+ messages in thread
From: Patrick McHardy @ 2004-10-19 22:13 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, YOSHIFUJI Hideaki
[-- Attachment #1: Type: text/plain, Size: 119 bytes --]
The recent changes to ip6_route_add added multiple leaks in
error paths. This patch should fix them.
Regards
Patrick
[-- Attachment #2: p2 --]
[-- Type: text/plain, Size: 1048 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/10/19 23:46:56+02:00 kaber@coreworks.de
# [IPV6]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv6/route.c
# 2004/10/19 23:46:17+02:00 kaber@coreworks.de +8 -3
# [IPV6]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c 2004-10-19 23:52:23 +02:00
+++ b/net/ipv6/route.c 2004-10-19 23:52:23 +02:00
@@ -798,8 +798,10 @@
rt = ip6_dst_alloc();
- if (rt == NULL)
- return -ENOMEM;
+ if (rt == NULL) {
+ err = -ENOMEM;
+ goto out;
+ }
rt->u.dst.obsolete = -1;
rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info);
@@ -962,7 +964,10 @@
out:
if (dev)
dev_put(dev);
- dst_free((struct dst_entry *) rt);
+ if (idev)
+ in6_dev_put(idev);
+ if (rt)
+ dst_free((struct dst_entry *) rt);
return err;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
2004-10-19 22:13 [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths Patrick McHardy
@ 2004-10-20 6:35 ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-21 4:22 ` David S. Miller
2004-10-21 5:17 ` David S. Miller
1 sibling, 1 reply; 4+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-10-20 6:35 UTC (permalink / raw)
To: kaber, davem; +Cc: netdev
[-- Attachment #1: Type: Text/Plain, Size: 326 bytes --]
In article <417591A2.4090201@trash.net> (at Wed, 20 Oct 2004 00:13:54 +0200), Patrick McHardy <kaber@trash.net> says:
> The recent changes to ip6_route_add added multiple leaks in
> error paths. This patch should fix them.
Agreed. David, please apply.
Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
--yoshfuji
[-- Attachment #2: Type: Message/Rfc822, Size: 3068 bytes --]
[-- Attachment #2.1.1: Type: text/plain, Size: 119 bytes --]
The recent changes to ip6_route_add added multiple leaks in
error paths. This patch should fix them.
Regards
Patrick
[-- Attachment #2.1.2: p2 --]
[-- Type: text/plain, Size: 1048 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/10/19 23:46:56+02:00 kaber@coreworks.de
# [IPV6]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv6/route.c
# 2004/10/19 23:46:17+02:00 kaber@coreworks.de +8 -3
# [IPV6]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c 2004-10-19 23:52:23 +02:00
+++ b/net/ipv6/route.c 2004-10-19 23:52:23 +02:00
@@ -798,8 +798,10 @@
rt = ip6_dst_alloc();
- if (rt == NULL)
- return -ENOMEM;
+ if (rt == NULL) {
+ err = -ENOMEM;
+ goto out;
+ }
rt->u.dst.obsolete = -1;
rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info);
@@ -962,7 +964,10 @@
out:
if (dev)
dev_put(dev);
- dst_free((struct dst_entry *) rt);
+ if (idev)
+ in6_dev_put(idev);
+ if (rt)
+ dst_free((struct dst_entry *) rt);
return err;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
2004-10-20 6:35 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2004-10-21 4:22 ` David S. Miller
0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-10-21 4:22 UTC (permalink / raw)
To: yoshfuji; +Cc: kaber, netdev
On Wed, 20 Oct 2004 15:35:25 +0900 (JST)
YOSHIFUJI Hideaki / ^[$B5HF#1QL@^[(B <yoshfuji@linux-ipv6.org> wrote:
> In article <417591A2.4090201@trash.net> (at Wed, 20 Oct 2004 00:13:54 +0200), Patrick McHardy <kaber@trash.net> says:
>
> > The recent changes to ip6_route_add added multiple leaks in
> > error paths. This patch should fix them.
>
> Agreed. David, please apply.
>
> Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
2004-10-19 22:13 [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths Patrick McHardy
2004-10-20 6:35 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2004-10-21 5:17 ` David S. Miller
1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-10-21 5:17 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev, yoshfuji
On Wed, 20 Oct 2004 00:13:54 +0200
Patrick McHardy <kaber@trash.net> wrote:
> The recent changes to ip6_route_add added multiple leaks in
> error paths. This patch should fix them.
Applied already, as mentioned in my response to Yoshifuji-san's
ACK of this patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-10-21 5:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-19 22:13 [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths Patrick McHardy
2004-10-20 6:35 ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-21 4:22 ` David S. Miller
2004-10-21 5:17 ` David S. Miller
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).