Skip to content

Commit

Permalink
net: wan: sbni: fix device usage count
Browse files Browse the repository at this point in the history
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: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sudip Mukherjee authored and David S. Miller committed Sep 6, 2015
1 parent 25b4a44 commit bd516bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wan/sbni.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit bd516bd

Please sign in to comment.