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 /target/linux/generic/files/drivers/net | |
parent | d6f02b62d4c2a6d9da93c24c1f47af066aec4ad3 (diff) | |
download | mtk-20170518-297ac9a7f1a7c01521d834e07c44a45620257069.zip mtk-20170518-297ac9a7f1a7c01521d834e07c44a45620257069.tar.gz mtk-20170518-297ac9a7f1a7c01521d834e07c44a45620257069.tar.bz2 |
kernel: swconfig: add a missing unlock in error path
SVN-Revision: 28753
Diffstat (limited to 'target/linux/generic/files/drivers/net')
-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 88fa244..2038330 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); |