diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-11-04 14:38:31 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2011-11-04 14:38:31 +0000 |
commit | 297ac9a7f1a7c01521d834e07c44a45620257069 (patch) | |
tree | f0f2969eae405f7766e18ef3e0e11be5ba298337 | |
parent | d6f02b62d4c2a6d9da93c24c1f47af066aec4ad3 (diff) | |
download | upstream-297ac9a7f1a7c01521d834e07c44a45620257069.tar.gz upstream-297ac9a7f1a7c01521d834e07c44a45620257069.tar.bz2 upstream-297ac9a7f1a7c01521d834e07c44a45620257069.zip |
kernel: swconfig: add a missing unlock in error path
SVN-Revision: 28753
-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); |