From 297ac9a7f1a7c01521d834e07c44a45620257069 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Fri, 4 Nov 2011 14:38:31 +0000 Subject: [PATCH] kernel: swconfig: add a missing unlock in error path SVN-Revision: 28753 --- target/linux/generic/files/drivers/net/phy/swconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index 88fa244bc89c..2038330ba278 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); -- 2.30.2