diff options
-rw-r--r-- | drivers/target/target_core_spc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 84f9e96e8ace..f8857d4eac66 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
@@ -641,11 +641,10 @@ spc_emulate_inquiry(struct se_cmd *cmd) | |||
641 | 641 | ||
642 | out: | 642 | out: |
643 | rbuf = transport_kmap_data_sg(cmd); | 643 | rbuf = transport_kmap_data_sg(cmd); |
644 | if (!rbuf) | 644 | if (rbuf) { |
645 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 645 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
646 | 646 | transport_kunmap_data_sg(cmd); | |
647 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 647 | } |
648 | transport_kunmap_data_sg(cmd); | ||
649 | 648 | ||
650 | if (!ret) | 649 | if (!ret) |
651 | target_complete_cmd(cmd, GOOD); | 650 | target_complete_cmd(cmd, GOOD); |