All further loops will still fail the conditional so just bail right away. Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> --- drivers/target/target_core_spc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 021c3f4..8f52974 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -1162,7 +1162,7 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd) */ lun_count++; if ((offset + 8) > cmd->data_length) - continue; + break; int_to_scsilun(deve->mapped_lun, (struct scsi_lun *)&buf[offset]); offset += 8; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html