Skip to contentSkip to conversation

decnet: netdevice refcount leak

PATCH Applied Eric Dumazet 2 participants 2 messages Nov 6, 2009

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

PATCH 1/1 decnet: netdevice refcount leak

David, if you accept the following patch for net-2.6, it would help me if you also can pull it in net-next-2.6

Thanks

[PATCH] decnet: netdevice refcount leak

While working on device refcount stuff, I found a device refcount leak through DECNET.
This nasty bug can be used to hold refcounts on any !DECNET netdevice.

---
 net/decnet/sysctl_net_decnet.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
net/decnet/sysctl_net_decnet.c +3 -4
index 26b0ab1..2036568 100644
@@ -263,11 +263,10 @@ static int dn_def_dev_strategy(ctl_table *table,
 			return -ENODEV;
 
 		rv = -ENODEV;
-		if (dev->dn_ptr != NULL) {
+		if (dev->dn_ptr != NULL)
 			rv = dn_dev_set_default(dev, 1);
-			if (rv)
-				dev_put(dev);
-		}
+		if (rv)
+			dev_put(dev);
 	}
 
 	return rv;
maintainer Applied
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Fri, 06 Nov 2009 09:43:31 +0100

Quoted 2 lines

David, if you accept the following patch for net-2.6, it would help me if you also can pull it in net-next-2.6

Applied to net-2.6, and net-2.6 is now merged into net-next-2.6, thanks.