]> err.no Git - linux-2.6/commitdiff
[DECNET]: Fix refcount
authorPatrick Caulfield <patrick@tykepenguin.com>
Wed, 29 Mar 2006 21:57:31 +0000 (13:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2006 21:57:31 +0000 (13:57 -0800)
From: Patrick Caulfield <patrick@tykepenguin.com>

This patch fixes a bug in the reference counting for the default
DECnet device.

If the device is changed, then the new device had its refcount
decremented rather than the old one!

Signed-off-by: David S. Miller <davem@davemloft.net>
net/decnet/dn_dev.c

index d2ae9893ca17392d2eea5472ee4b423156b4de1b..a26ff9f44576fffb0c20dd7725a463c291db989e 100644 (file)
@@ -620,7 +620,7 @@ int dn_dev_set_default(struct net_device *dev, int force)
        }
        write_unlock(&dndev_lock);
        if (old)
-               dev_put(dev);
+               dev_put(old);
        return rv;
 }