Patchwork [Open-FCoE] fcoe: Fix missing mutex_unlock in fcoe_sysfs_fcf_add error path

login
register
mail settings
Submitter Neil Horman
Date Oct. 8, 2013, 3:43 p.m.
Message ID <1381247038-17249-1-git-send-email-nhorman@tuxdriver.com>
Download mbox | patch
Permalink /patch/110/
State Accepted
Headers show

Comments

Neil Horman - Oct. 8, 2013, 3:43 p.m.
In this pending patch:
http://patchwork.open-fcoe.org/patch/104/

Tomas Henzl noted that the error path when fcoe_fcf_device_add fails, was
missing a mutex_unlock call.

Not sure what staet the integration of the above patch is in, but if you could
either merge this with it, or apply it on top of what you already have, that
would be great.  Thanks!

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: thenzl@redhat.com
Reported-by: thenzl@redhat.com
CC: Robert Love <robert.w.love@intel.com>
---
 drivers/scsi/fcoe/fcoe_ctlr.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 0cefbad..ce86585 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -204,6 +204,7 @@  static int fcoe_sysfs_fcf_add(struct fcoe_fcf *new)
 		fcf_dev = fcoe_fcf_device_add(ctlr_dev, temp);
 		if (unlikely(!fcf_dev)) {
 			rc = -ENOMEM;
+			mutex_unlock(&ctlr_dev->lock);
 			goto out;
 		}