[DECNET]: Fix refcount
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>
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index d2ae989..a26ff9f 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -620,7 +620,7 @@
}
write_unlock(&dndev_lock);
if (old)
- dev_put(dev);
+ dev_put(old);
return rv;
}