diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-09-03 02:00:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-05 20:32:53 -0400 |
commit | bd516bd1feeb3890502178a74228ec05271f2b6d (patch) | |
tree | 24e89e1951cff4c3005e89b3eba56bfd97c83165 /drivers/net/wan | |
parent | 25b4a44c19c83d98e8c0807a7ede07c1f28eab8b (diff) |
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: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/sbni.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 758c4ba1e97c..8fef8d83436d 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -1358,6 +1358,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
1358 | if( !slave_dev || !(slave_dev->flags & IFF_UP) ) { | 1358 | if( !slave_dev || !(slave_dev->flags & IFF_UP) ) { |
1359 | netdev_err(dev, "trying to enslave non-active device %s\n", | 1359 | netdev_err(dev, "trying to enslave non-active device %s\n", |
1360 | slave_name); | 1360 | slave_name); |
1361 | if (slave_dev) | ||
1362 | dev_put(slave_dev); | ||
1361 | return -EPERM; | 1363 | return -EPERM; |
1362 | } | 1364 | } |
1363 | 1365 | ||