Skip to contentSkip to conversation

ipv6: release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

PATCH Applied [email protected] 3 participants 3 messages Jan 13, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

From: RongQing.Li <[email protected]>

release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

---
 net/ipv6/route.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv6/route.c +1 -0
index 07361df..8c2e3ab 100644
@@ -1091,6 +1091,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
 	else {
 		neigh = ip6_neigh_lookup(&rt->dst, &fl6->daddr);
 		if (IS_ERR(neigh)) {
+			in6_dev_put(idev);
 			dst_free(&rt->dst);
 			return ERR_CAST(neigh);
 		}
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw

Le vendredi 13 janvier 2012 à 16:33 +0800, [email protected] a écrit :

Quoted 14 lines

From: RongQing.Li <[email protected]>

release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

---
 net/ipv6/route.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv6/route.c +0 -0
index 07361df..8c2e3ab 100644

net/ipv6/route.c struct dst_entry *icmp6_dst_alloc(struct net_device *dev, · line 1097

Quoted 7 lines
net/ipv6/route.c +1 -0
@@ -1091,6 +1091,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
 	else {
 		neigh = ip6_neigh_lookup(&rt->dst, &fl6->daddr);
 		if (IS_ERR(neigh)) {
+			in6_dev_put(idev);
 			dst_free(&rt->dst);
 			return ERR_CAST(neigh);
 		}

Good catch, thanks.

Bug added in commit b43faac6906 (ipv6: If neigh lookup fails during icmp6 dst allocation, propagate error.),

maintainer Applied
#2 lore raw

From: Eric Dumazet <[email protected]>
Date: Fri, 13 Jan 2012 10:48:41 +0100

Quoted 26 lines

Le vendredi 13 janvier 2012 à 16:33 +0800, [email protected] a écrit :

Quoted 14 lines

From: RongQing.Li <[email protected]>

release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

---
 net/ipv6/route.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv6/route.c +0 -0
index 07361df..8c2e3ab 100644

net/ipv6/route.c struct dst_entry *icmp6_dst_alloc(struct net_device *dev, · line 1097

Quoted 7 lines
net/ipv6/route.c +1 -0
@@ -1091,6 +1091,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
 	else {
 		neigh = ip6_neigh_lookup(&rt->dst, &fl6->daddr);
 		if (IS_ERR(neigh)) {
+			in6_dev_put(idev);
 			dst_free(&rt->dst);
 			return ERR_CAST(neigh);
 		}

Good catch, thanks.

Quoted 4 lines

Bug added in commit b43faac6906 (ipv6: If neigh lookup fails during icmp6 dst allocation, propagate error.),

Applied, thanks everyone.