kernel: swconfig: add a missing unlock in error path

SVN-Revision: 28753
lede-17.01
Gabor Juhos 2011-11-04 14:38:31 +00:00
parent d6f02b62d4
commit 297ac9a7f1
1 changed files with 3 additions and 1 deletions

View File

@ -894,8 +894,10 @@ register_switch(struct switch_dev *dev, struct net_device *netdev)
} }
i = find_first_zero_bit(&in_use, max_switches); i = find_first_zero_bit(&in_use, max_switches);
if (i == max_switches) if (i == max_switches) {
swconfig_unlock();
return -ENFILE; return -ENFILE;
}
/* fill device name */ /* fill device name */
snprintf(dev->devname, IFNAMSIZ, SWCONFIG_DEVNAME, i); snprintf(dev->devname, IFNAMSIZ, SWCONFIG_DEVNAME, i);