public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] scsi: qla1280.c: fix kernel Oops when debug level > 2
@ 2025-01-25  9:49 Magnus Lindholm
  2025-02-04  3:33 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Lindholm @ 2025-01-25  9:49 UTC (permalink / raw)
  To: linmag7, James.Bottomley, martin.petersen, linux-scsi,
	linux-kernel

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>
---
 drivers/scsi/qla1280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 8958547ac111..fed07b146070 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -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 "
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] scsi: qla1280.c: fix kernel Oops when debug level > 2
  2025-01-25  9:49 [PATCH v1] scsi: qla1280.c: fix kernel Oops when debug level > 2 Magnus Lindholm
@ 2025-02-04  3:33 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2025-02-04  3:33 UTC (permalink / raw)
  To: James.Bottomley, linux-scsi, linux-kernel, Magnus Lindholm
  Cc: Martin K . Petersen

On Sat, 25 Jan 2025 10:49:22 +0100, Magnus Lindholm wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-04  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-25  9:49 [PATCH v1] scsi: qla1280.c: fix kernel Oops when debug level > 2 Magnus Lindholm
2025-02-04  3:33 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox