Skip to content

Commit

Permalink
decnet: netdevice refcount leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 6, 2009
1 parent f9dd09c commit 887e671
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/decnet/sysctl_net_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 887e671

Please sign in to comment.