From: Eric Dumazet Date: Fri, 6 Nov 2009 08:50:39 +0000 (-0800) Subject: decnet: netdevice refcount leak X-Git-Tag: submit/tizen/20141203.153721~13699^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=887e671f324d9898aaedb29a6ece6c853c394067;p=platform%2Fkernel%2Flinux-arm64.git 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 Signed-off-by: David S. Miller --- diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c index 26b0ab1e9f5..2036568beea 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;