summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-04 14:38:31 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-04 14:38:31 +0000
commit47cebba347fe9e484656576a0df3459921d517d5 (patch)
treee96fd0a27eaf740e9214e1644162e1e9e00d56a8 /target/linux/generic/files
parent366b2f2c1288a9f18f1a6edf5c6745da3eee80d6 (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/linux/generic/files')
-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 88fa244bc..2038330ba 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);