summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorChandrakanth Patil <chandrakanth.patil@broadcom.com>2026-08-26 02:34:09 +0530
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-09-09 22:08:16 -0400
commit052aea807cfbcefaf5b6ed8202f65da1fc65f4a0 (patch)
treea0da1630de8f6f444c1e0c017cd85f656641652e /drivers/scsi
parent7d572b4dc4ed0494e67097d4b7368666655f5c99 (diff)
downloadlinux-next-052aea807cfbcefaf5b6ed8202f65da1fc65f4a0.tar.gz
linux-next-052aea807cfbcefaf5b6ed8202f65da1fc65f4a0.zip
scsi: mpi3mr: zero out diagnostic buffer status memory
Memory allocated for the BSG diagnostic buffer status is not zeroed before it is copied back to user space. Several fields in this structure are reserved and never written by the driver. Use kzalloc() instead of kmalloc() to zero out the allocated memory. Fixes: 78b506984ebe ("scsi: mpi3mr: Add ioctl support for HDB") Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Link: https://patch.msgid.link/20260825210411.301535-16-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_app.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index f5b48c95cf05..0cdcb8d236d3 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -1244,7 +1244,7 @@ static long mpi3mr_bsg_query_hdb(struct mpi3mr_ioc *mrioc,
length = (sizeof(*hbd_status) + ((MPI3MR_MAX_NUM_HDB - 1) *
sizeof(*hbd_status_entry)));
- hbd_status = kmalloc(length, GFP_KERNEL);
+ hbd_status = kzalloc(length, GFP_KERNEL);
if (!hbd_status)
return -ENOMEM;
hbd_status_entry = &hbd_status->entry[0];