Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349467
b: refs/heads/master
c: 8b4b0dc
h: refs/heads/master
i:
  349465: be64392
  349463: 59cd4de
v: v3
  • Loading branch information
Nicholas Bellinger committed Jan 29, 2013
1 parent 3e0b06f commit a441a5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 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: cab9609b449ae5a6875d7d4cef32a814527a3baa
refs/heads/master: 8b4b0dcbf70d10f3acd6a88fca0679ca711066e0
18 changes: 8 additions & 10 deletions trunk/drivers/target/target_core_sbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ sbc_emulate_readcapacity(struct se_cmd *cmd)
buf[7] = dev->dev_attrib.block_size & 0xff;

rbuf = transport_kmap_data_sg(cmd);
if (!rbuf)
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;

memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length));
transport_kunmap_data_sg(cmd);
if (rbuf) {
memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length));
transport_kunmap_data_sg(cmd);
}

target_complete_cmd(cmd, GOOD);
return 0;
Expand Down Expand Up @@ -97,11 +96,10 @@ sbc_emulate_readcapacity_16(struct se_cmd *cmd)
buf[14] = 0x80;

rbuf = transport_kmap_data_sg(cmd);
if (!rbuf)
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;

memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length));
transport_kunmap_data_sg(cmd);
if (rbuf) {
memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length));
transport_kunmap_data_sg(cmd);
}

target_complete_cmd(cmd, GOOD);
return 0;
Expand Down

0 comments on commit a441a5b

Please sign in to comment.