Skip to content

Commit cee4f92

Browse files
arndbmartinkpetersen
authored andcommitted
scsi: scsi_debug: Fix uninitialized variable use
It appears that a typo has made it into the newly added code drivers/scsi/scsi_debug.c:3035:3: error: variable 'len' is uninitialized when used here [-Werror,-Wuninitialized] 3035 | len += resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce); | ^~~ Replace the '+=' with the intended '=' here. Fixes: 568354b ("scsi: scsi_debug: Add compression mode page for tapes") Acked-by: Kai Mäkisara <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ed3e484 commit cee4f92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/scsi_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,7 @@ static int resp_mode_sense(struct scsi_cmnd *scp,
30323032
case 0xf: /* Compression Mode Page (tape) */
30333033
if (!is_tape)
30343034
goto bad_pcode;
3035-
len += resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce);
3035+
len = resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce);
30363036
offset += len;
30373037
break;
30383038
case 0x11: /* Partition Mode Page (tape) */

0 commit comments

Comments
 (0)