提交 66331e8c 编写于 作者: D Dan Carpenter 提交者: James Bottomley

[SCSI] mpt3sas: cut and paste bug storing trigger mpi

ioc->diag_trigger_mpi is an SL_WH_MPI_TRIGGERS_T struct.

There is a cut and paste error here and SL_WH_EVENT_TRIGGERS_T is used
instead of SL_WH_MPI_TRIGGERS_T.  Since the SL_WH_EVENT_TRIGGERS_T is
smaller than SL_WH_MPI_TRIGGERS_T, it means we only clear part of the
buffer.

I've changed it to use sizeof(ioc->diag_trigger_mpi) which is a bit
simpler.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: N"Sreekanth Reddy" <Sreekanth.reddy@lsi.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 f07cda8f
...@@ -3136,7 +3136,7 @@ _ctl_diag_trigger_mpi_store(struct device *cdev, ...@@ -3136,7 +3136,7 @@ _ctl_diag_trigger_mpi_store(struct device *cdev,
spin_lock_irqsave(&ioc->diag_trigger_lock, flags); spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
sz = min(sizeof(struct SL_WH_MPI_TRIGGERS_T), count); sz = min(sizeof(struct SL_WH_MPI_TRIGGERS_T), count);
memset(&ioc->diag_trigger_mpi, 0, memset(&ioc->diag_trigger_mpi, 0,
sizeof(struct SL_WH_EVENT_TRIGGERS_T)); sizeof(ioc->diag_trigger_mpi));
memcpy(&ioc->diag_trigger_mpi, buf, sz); memcpy(&ioc->diag_trigger_mpi, buf, sz);
if (ioc->diag_trigger_mpi.ValidEntries > NUM_VALID_ENTRIES) if (ioc->diag_trigger_mpi.ValidEntries > NUM_VALID_ENTRIES)
ioc->diag_trigger_mpi.ValidEntries = NUM_VALID_ENTRIES; ioc->diag_trigger_mpi.ValidEntries = NUM_VALID_ENTRIES;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册