| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths |
| From: | Patrick McHardy <kaber@xxxxxxxxx> |
| Date: | Wed, 20 Oct 2004 00:13:54 +0200 |
| Cc: | netdev@xxxxxxxxxxx, YOSHIFUJI Hideaki <yoshfuji@xxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 |
The recent changes to ip6_route_add added multiple leaks in error paths. This patch should fix them. Regards Patrick # This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/10/19 23:46:56+02:00 kaber@xxxxxxxxxxxx
# [IPV6]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
#
# Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
#
# net/ipv6/route.c
# 2004/10/19 23:46:17+02:00 kaber@xxxxxxxxxxxx +8 -3
# [IPV6]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths
#
# Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
#
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;
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: tun.c patch to fix "smp_processor_id() in preemptible code", Lee Revell |
|---|---|
| Next by Date: | Re: tun.c patch to fix "smp_processor_id() in preemptible code", David S. Miller |
| Previous by Thread: | [PATCH 2.6.9]: Fix inet6_dev reference leak in ndisc_dst_alloc error path, Patrick McHardy |
| Next by Thread: | Re: [PATCH 2.6.9]: Fix netdevice/inet6_dev reference leaks in ip6_route_add error paths, YOSHIFUJI Hideaki / 吉藤英明 |
| Indexes: | [Date] [Thread] [Top] [All Lists] |