aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-11-04 14:38:31 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-11-04 14:38:31 +0000
commit2149ed4fe1cd50eaa8e3148908ff1beca7ba6e22 (patch)
treee96fd0a27eaf740e9214e1644162e1e9e00d56a8 /target/linux/generic
parentca5eb9dd8fc2af922825171992cba6b33836e9f4 (diff)
downloadupstream-2149ed4fe1cd50eaa8e3148908ff1beca7ba6e22.tar.gz
upstream-2149ed4fe1cd50eaa8e3148908ff1beca7ba6e22.tar.bz2
upstream-2149ed4fe1cd50eaa8e3148908ff1beca7ba6e22.zip
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/linux/generic')
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig.c4
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);