summaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-06 00:50:39 -0800
committerDavid S. Miller <davem@davemloft.net>2009-11-06 00:50:39 -0800
commit887e671f324d9898aaedb29a6ece6c853c394067 (patch)
treeff6e580e0342453b3e7251681ad6bc67ad7958a7 /net/decnet
parentf9dd09c7f7199685601d75882447a6598be8a3e0 (diff)
downloadlinux-887e671f324d9898aaedb29a6ece6c853c394067.tar.gz
linux-887e671f324d9898aaedb29a6ece6c853c394067.tar.bz2
linux-887e671f324d9898aaedb29a6ece6c853c394067.zip
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. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/sysctl_net_decnet.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index 26b0ab1e9f56..2036568beea9 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -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;