The INQUIRY data length is minimum 36 bytes plus additional length jindicated in the descriptor. See SPC4-r37 section 6.6.2. The "len" here is the total length of the INQUIRY data. Make sure to include the 36 initial bytes. Signed-off-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx> --- drivers/target/target_core_spc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index dd799158609d..1801e10cd575 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -756,7 +756,7 @@ spc_emulate_inquiry(struct se_cmd *cmd) } ret = spc_emulate_inquiry_std(cmd, buf); - len = buf[4] + 5; + len = buf[4] + 5 + INQUIRY_LEN; goto out; } -- 2.28.0