From cee4f928beee900fd05da24d6b5e9127d2adae37 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 25 Feb 2025 10:56:47 +0100 Subject: [PATCH] scsi: scsi_debug: Fix uninitialized variable use MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: 568354b24c7d ("scsi: scsi_debug: Add compression mode page for tapes") Acked-by: Kai Mäkisara Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20250225095651.2636811-1-arnd@kernel.org Signed-off-by: Martin K. Petersen --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2208dcba346e..523f054912e1 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -3032,7 +3032,7 @@ static int resp_mode_sense(struct scsi_cmnd *scp, case 0xf: /* Compression Mode Page (tape) */ if (!is_tape) goto bad_pcode; - len += resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce); + len = resp_compression_m_pg(ap, pcontrol, target, devip->tape_dce); offset += len; break; case 0x11: /* Partition Mode Page (tape) */ -- 2.50.1