kernel: swconfig: add a missing unlock in error path

SVN-Revision: 28753
This commit is contained in:
Gabor Juhos 2011-11-04 14:38:31 +00:00
parent d6f02b62d4
commit 297ac9a7f1

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);
if (i == max_switches)
if (i == max_switches) {
swconfig_unlock();
return -ENFILE;
}
/* fill device name */
snprintf(dev->devname, IFNAMSIZ, SWCONFIG_DEVNAME, i);