From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>,
Sreekanth Reddy <Sreekanth.Reddy@lsi.com>, <support@lsi.com>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
<DL-MPTFusionLinux@lsi.com>, <linux-scsi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi
Date: Fri, 07 Dec 2012 09:41:56 +0100 [thread overview]
Message-ID: <953b00ff89996c4a3681b3c8f425462b@sf-mail.de> (raw)
In-Reply-To: <20121207062801.GD18220@elgon.mountain>
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Only needed in linux-next.
>
> This is a static analysis patch. Even though I'm pretty sure it's
> correct, I'm not able to test it.
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> index 8af944d..3e35e64 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> @@ -3136,7 +3136,7 @@ _ctl_diag_trigger_mpi_store(struct device
> *cdev,
> spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
> sz = min(sizeof(struct SL_WH_MPI_TRIGGERS_T), count);
> memset(&ioc->diag_trigger_mpi, 0,
> - sizeof(struct SL_WH_EVENT_TRIGGERS_T));
> + sizeof(struct SL_WH_MPI_TRIGGERS_T));
> memcpy(&ioc->diag_trigger_mpi, buf, sz);
> if (ioc->diag_trigger_mpi.ValidEntries > NUM_VALID_ENTRIES)
> ioc->diag_trigger_mpi.ValidEntries = NUM_VALID_ENTRIES;
Then just use sizeof(ioc->diag_trigger_mpi), then it's irrelevant how
that type is ever called.
Eike
next prev parent reply other threads:[~2012-12-07 8:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 6:28 Dan Carpenter
2012-12-07 8:41 ` Rolf Eike Beer [this message]
2012-12-07 10:56 ` [patch v2] " Dan Carpenter
2012-12-07 11:00 ` [patch] " Dan Carpenter
2012-12-11 9:02 ` Reddy, Sreekanth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=953b00ff89996c4a3681b3c8f425462b@sf-mail.de \
--to=eike-kernel@sf-tec.de \
--cc=DL-MPTFusionLinux@lsi.com \
--cc=JBottomley@parallels.com \
--cc=Nagalakshmi.Nandigama@lsi.com \
--cc=Sreekanth.Reddy@lsi.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=support@lsi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®