mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
kernel: swconfig: add a missing unlock in error path
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28753 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
ca5eb9dd8f
commit
2149ed4fe1
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user