diff mbox

[1/3,-next] tcm_vhost: unlock on error in tcm_vhost_drop_nexus()

Message ID 20120712144752.GD24202@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter July 12, 2012, 2:47 p.m. UTC
We need to unlock here before returning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Nicholas A. Bellinger July 12, 2012, 9:47 p.m. UTC | #1
On Thu, 2012-07-12 at 17:47 +0300, Dan Carpenter wrote:
> We need to unlock here before returning.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index da0b8ac..d217bed 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -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!

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
index da0b8ac..d217bed 100644
--- a/drivers/vhost/tcm_vhost.c
+++ b/drivers/vhost/tcm_vhost.c
@@ -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));