Przeglądaj źródła

[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>
Patrick Caulfield 19 lat temu
rodzic
commit
6a57b2ee45
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      net/decnet/dn_dev.c

+ 1 - 1
net/decnet/dn_dev.c

@@ -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;
 }