diff mbox series

[15/36] target: Include INQUIRY length

Message ID 2557ef61dddba5056b9d89d73248bf4140e92f19.1657149962.git.Thinh.Nguyen@synopsys.com
State New
Headers show
Series usb: gadget: f_tcm: Enhance UASP driver | expand

Commit Message

Thinh Nguyen July 6, 2022, 11:35 p.m. UTC
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@synopsys.com>
---
 drivers/target/target_core_spc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;
 	}