Skip to contentSkip to conversation

net: wan: sbni: fix device usage count

PATCH Applied Sudip Mukherjee 2 participants 2 messages Sep 3, 2015 – Sep 6, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: wan: sbni: fix device usage count

dev_get_by_name() will increment the usage count if the matching device is found. But we were not decrementing the count if we have got the device and the device is non-active.

---
 drivers/net/wan/sbni.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wan/sbni.c +2 -0
index 758c4ba..8fef8d8 100644
@@ -1358,6 +1358,8 @@ sbni_ioctl( struct net_device  *dev,  struct ifreq  *ifr,  int  cmd )
 		if( !slave_dev  ||  !(slave_dev->flags & IFF_UP) ) {
 			netdev_err(dev, "trying to enslave non-active device %s\n",
 				   slave_name);
+			if (slave_dev)
+				dev_put(slave_dev);
 			return  -EPERM;
 		}
 
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw

From: Sudip Mukherjee <[email protected]>
Date: Thu, 3 Sep 2015 11:30:30 +0530

Quoted 5 lines

dev_get_by_name() will increment the usage count if the matching device is found. But we were not decrementing the count if we have got the device and the device is non-active.

Applied, thanks.