kernel: swconfig: add a missing unlock in error path
SVN-Revision: 28753
This commit is contained in:
parent
d6f02b62d4
commit
297ac9a7f1
@ -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…
Reference in New Issue
Block a user