]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: qla1280: Fix kernel oops when debug level > 2
authorMagnus Lindholm <linmag7@gmail.com>
Sat, 25 Jan 2025 09:49:22 +0000 (10:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:50 +0000 (14:31 +0200)
[ Upstream commit 5233e3235dec3065ccc632729675575dbe3c6b8a ]

A null dereference or oops exception will eventually occur when qla1280.c
driver is compiled with DEBUG_QLA1280 enabled and ql_debug_level > 2.  I
think its clear from the code that the intention here is sg_dma_len(s) not
length of sg_next(s) when printing the debug info.

Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://lore.kernel.org/r/20250125095033.26188-1-linmag7@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla1280.c

index d0b4e063bfe1e4c0fbeb6524a2b84f24402a9a55..eb8e9c54837e097e18ac0cf132c448ed531b8f71 100644 (file)
@@ -2875,7 +2875,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
                        dprintk(3, "S/G Segment phys_addr=%x %x, len=0x%x\n",
                                cpu_to_le32(upper_32_bits(dma_handle)),
                                cpu_to_le32(lower_32_bits(dma_handle)),
-                               cpu_to_le32(sg_dma_len(sg_next(s))));
+                               cpu_to_le32(sg_dma_len(s)));
                        remseg--;
                }
                dprintk(5, "qla1280_64bit_start_scsi: Scatter/gather "