Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: target: spc: Fix RSOC parameter data header size

The SPC document states that "The COMMAND DATA LENGTH field indicates the
length in bytes of the command descriptor list".

The length should be subtracted by 4 to represent the length of the
description list, not 3.

Signed-off-by: Chaohai Chen <wdhh66@163.com>
Link: https://lore.kernel.org/r/20250115070739.216154-1-wdhh66@163.com
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Chaohai Chen and committed by
Martin K. Petersen
b5053231 640a6af5

+1 -1
+1 -1
drivers/target/target_core_spc.c
··· 2243 2243 response_length += spc_rsoc_encode_command_descriptor( 2244 2244 &buf[response_length], rctd, descr); 2245 2245 } 2246 - put_unaligned_be32(response_length - 3, buf); 2246 + put_unaligned_be32(response_length - 4, buf); 2247 2247 } else { 2248 2248 response_length = spc_rsoc_encode_one_command_descriptor( 2249 2249 &buf[response_length], rctd, descr,