Skip to contentSkip to conversation

tcm_vhost: unlock on error in tcm_vhost_drop_nexus()

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 12, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 tcm_vhost: unlock on error in tcm_vhost_drop_nexus()

We need to unlock here before returning.

drivers/vhost/tcm_vhost.c +1 -0
index da0b8ac..d217bed 100644
@@ -1189,6 +1189,7 @@ static int tcm_vhost_drop_nexus(
 	}
 
 	if (atomic_read(&tpg->tv_tpg_vhost_count)) {
+		mutex_unlock(&tpg->tv_tpg_mutex);
 		pr_err("Unable to remove TCM_vHost I_T Nexus with"
 			" active TPG vhost count: %d\n",
 			atomic_read(&tpg->tv_tpg_vhost_count));
#1 lore raw
Quoted 9 lines · Dan Carpenter

We need to unlock here before returning.

drivers/vhost/tcm_vhost.c +0 -0
index da0b8ac..d217bed 100644

drivers/vhost/tcm_vhost.c static int tcm_vhost_drop_nexus( · line 1195

Quoted 7 lines
drivers/vhost/tcm_vhost.c +1 -0
@@ -1189,6 +1189,7 @@ static int tcm_vhost_drop_nexus(
 	}
 
 	if (atomic_read(&tpg->tv_tpg_vhost_count)) {
+		mutex_unlock(&tpg->tv_tpg_mutex);
 		pr_err("Unable to remove TCM_vHost I_T Nexus with"
 			" active TPG vhost count: %d\n",
 			atomic_read(&tpg->tv_tpg_vhost_count));

Applied. Thanks Dan!