Commit 40a4c2c3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: megaraid_sas: array overflow in megasas_dump_frame()

The "sz" variable is in terms of bytes, but we're treating the buffer as
an array of __le32 so we have to divide by 4.

Fixes: def0eab3 ("scsi: megaraid_sas: enhance debug logs in OCR context")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8e305cb2
......@@ -2754,7 +2754,7 @@ megasas_dump_frame(void *mpi_request, int sz)
__le32 *mfp = (__le32 *)mpi_request;
printk(KERN_INFO "IO request frame:\n\t");
for (i = 0; i < sz; i++) {
for (i = 0; i < sz / sizeof(__le32); i++) {
if (i && ((i % 8) == 0))
printk("\n\t");
printk("%08x ", le32_to_cpu(mfp[i]));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment