diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-11-04 14:38:31 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-11-04 14:38:31 +0000 |
commit | 47cebba347fe9e484656576a0df3459921d517d5 (patch) | |
tree | e96fd0a27eaf740e9214e1644162e1e9e00d56a8 /target | |
parent | 366b2f2c1288a9f18f1a6edf5c6745da3eee80d6 (diff) |
kernel: swconfig: add a missing unlock in error path
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28753 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/swconfig.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index 88fa244bc8..2038330ba2 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c @@ -894,8 +894,10 @@ register_switch(struct switch_dev *dev, struct net_device *netdev) } i = find_first_zero_bit(&in_use, max_switches); - if (i == max_switches) + if (i == max_switches) { + swconfig_unlock(); return -ENFILE; + } /* fill device name */ snprintf(dev->devname, IFNAMSIZ, SWCONFIG_DEVNAME, i); |