Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd516bd1 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by David S. Miller
Browse files

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.

Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25b4a44c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
		}