Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361713
b: refs/heads/master
c: 038e0af
h: refs/heads/master
i:
  361711: 340eb8f
v: v3
  • Loading branch information
Asias He authored and Nicholas Bellinger committed Mar 18, 2013
1 parent c58454a commit 1fe2f2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0fb889b83186e54c0cfa79516599f2267fb553fb
refs/heads/master: 038e0af4a4fc4db9631aef39ab53e5d991b972ef
12 changes: 8 additions & 4 deletions trunk/drivers/vhost/tcm_vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static int vhost_scsi_clear_endpoint(
for (index = 0; index < vs->dev.nvqs; ++index) {
if (!vhost_vq_access_ok(&vs->vqs[index])) {
ret = -EFAULT;
goto err;
goto err_dev;
}
}
for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) {
Expand All @@ -860,10 +860,11 @@ static int vhost_scsi_clear_endpoint(
if (!tv_tpg)
continue;

mutex_lock(&tv_tpg->tv_tpg_mutex);
tv_tport = tv_tpg->tport;
if (!tv_tport) {
ret = -ENODEV;
goto err;
goto err_tpg;
}

if (strcmp(tv_tport->tport_name, t->vhost_wwpn)) {
Expand All @@ -872,16 +873,19 @@ static int vhost_scsi_clear_endpoint(
tv_tport->tport_name, tv_tpg->tport_tpgt,
t->vhost_wwpn, t->vhost_tpgt);
ret = -EINVAL;
goto err;
goto err_tpg;
}
tv_tpg->tv_tpg_vhost_count--;
vs->vs_tpg[target] = NULL;
vs->vs_endpoint = false;
mutex_unlock(&tv_tpg->tv_tpg_mutex);
}
mutex_unlock(&vs->dev.mutex);
return 0;

err:
err_tpg:
mutex_unlock(&tv_tpg->tv_tpg_mutex);
err_dev:
mutex_unlock(&vs->dev.mutex);
return ret;
}
Expand Down

0 comments on commit 1fe2f2a

Please sign in to comment.