Skip to contentSkip to conversation

scsi: qla1280.c: fix kernel Oops when debug level > 2

PATCH Applied Magnus Lindholm 2 participants 2 messages Jan 25, 2025 – Feb 4, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: qla1280.c: fix kernel Oops when debug level > 2

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.

---
 drivers/scsi/qla1280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla1280.c +1 -1
index 8958547ac111..fed07b146070 100644
@@ -2867,7 +2867,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 "
Signature · 1 line
2.48.1
#1 lore raw
Quoted 6 lines · Magnus Lindholm

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.

Applied to 6.14/scsi-fixes, thanks!

[1/1] scsi: qla1280.c: fix kernel Oops when debug level > 2

      https://git.kernel.org/mkp/scsi/c/5233e3235dec
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering