summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt3sas/mpt3sas_ctl.c
diff options
context:
space:
mode:
authorSuganath Prabu <suganath-prabu.subramani@broadcom.com>2019-08-03 09:59:47 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2019-08-07 22:46:19 -0400
commite224e03b0c6a2381ed1ea5325c846582d87d6fae (patch)
tree746d574dae6031707517d99f7affd1f24623d481 /drivers/scsi/mpt3sas/mpt3sas_ctl.c
parentf23ca2cb2781102b560dbd96fe093b146fd8ec1a (diff)
downloadlinux-e224e03b0c6a2381ed1ea5325c846582d87d6fae.tar.bz2
scsi: mpt3sas: memset request frame before reusing
Driver gets a request frame from the free pool of DMA-able request frames and fill in the required information and pass the address of the frame to IOC/FW to pull the complete request frame. In certain places the driver used the request frame allocated from the free pool without completely clearing the previous data stored in it. The request contents were cleared only for the size of the new request to be issued and that left out some stale data in the unused part of the request. Though the IOC/FW is not expected to access the request beyond the specified size, it is good practice to clear complete request message frame. So reinitialize the complete request message frame with 0s before using it. Signed-off-by: Suganath Prabu <suganath-prabu.subramani@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpt3sas/mpt3sas_ctl.c')
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_ctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index b6483b7dd3f7..ab78bcf9fbc6 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -715,6 +715,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
ioc->ctl_cmds.status = MPT3_CMD_PENDING;
memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
request = mpt3sas_base_get_msg_frame(ioc, smid);
+ memset(request, 0, ioc->request_sz);
memcpy(request, mpi_request, karg.data_sge_offset*4);
ioc->ctl_cmds.smid = smid;
data_out_sz = karg.data_out_size;