Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264686
b: refs/heads/master
c: 0a02043
h: refs/heads/master
v: v3
  • Loading branch information
Nicholas Bellinger committed Oct 24, 2011
1 parent 4c8b681 commit dad2529
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce8762f6cd1e0e6d87a6d0b536635993aef0a697
refs/heads/master: 0a020436d8baf412bcf5997aee7796276ea773ae
12 changes: 12 additions & 0 deletions trunk/drivers/target/loopback/tcm_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ static int tcm_loop_queuecommand(
*/
tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
/*
* Ensure that this tl_tpg reference from the incoming sc->device->id
* has already been configured via tcm_loop_make_naa_tpg().
*/
if (!tl_tpg->tl_hba) {
set_host_byte(sc, DID_NO_CONNECT);
sc->scsi_done(sc);
return 0;
}
se_tpg = &tl_tpg->tl_se_tpg;
/*
* Determine the SAM Task Attribute and allocate tl_cmd and
Expand Down Expand Up @@ -1245,6 +1254,9 @@ void tcm_loop_drop_naa_tpg(
*/
core_tpg_deregister(se_tpg);

tl_tpg->tl_hba = NULL;
tl_tpg->tl_tpgt = 0;

pr_debug("TCM_Loop_ConfigFS: Deallocated Emulated %s"
" Target Port %s,t,0x%04x\n", tcm_loop_dump_proto_id(tl_hba),
config_item_name(&wwn->wwn_group.cg_item), tpgt);
Expand Down

0 comments on commit dad2529

Please sign in to comment.