From: Oliver Neukum <oneukum@suse.de>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
Ali Akcaagac <aliakc@web.de>, Jamie Lenehan <lenehan@twibble.org>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
dc395x@twibble.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: dc395x.c: Fix for possible null pointer dereference
Date: Mon, 19 May 2014 13:39:53 +0200 [thread overview]
Message-ID: <1400499593.31716.16.camel@linux-fkkt.site> (raw)
In-Reply-To: <Pine.LNX.4.64.1405182147500.23804@axis700.grange>
On Sun, 2014-05-18 at 21:50 +0200, Guennadi Liakhovetski wrote:
> On Sun, 18 May 2014, Rickard Strandqvist wrote:
>
> > There is otherwise a risk of a possible null pointer dereference.
> >
> > Was largely found by using a static code analysis program called cppcheck.
> >
> > Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> > ---
> > drivers/scsi/dc395x.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
> > index 83d9bf6..0d86bc7 100644
> > --- a/drivers/scsi/dc395x.c
> > +++ b/drivers/scsi/dc395x.c
> > @@ -2637,7 +2637,7 @@ static struct ScsiReqBlk *msgin_qtag(struct AdapterCtlBlk *acb,
> > struct ScsiReqBlk *srb = NULL;
> > struct ScsiReqBlk *i;
> > dprintkdbg(DBG_0, "msgin_qtag: (0x%p) tag=%i srb=%p\n",
> > - srb->cmd, tag, srb);
> > + srb ? srb->cmd : 0, tag, srb);
>
> There's not just a risk, it is a NULL-pointer dereference, so, just remove
> it, e.g. like
Indeed. Thank you both for catching this.
Regards
Oliver
next prev parent reply other threads:[~2014-05-19 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 16:09 Rickard Strandqvist
2014-05-18 19:50 ` Guennadi Liakhovetski
2014-05-19 11:39 ` Oliver Neukum [this message]
2014-05-20 21:20 ` Rickard Strandqvist
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=1400499593.31716.16.camel@linux-fkkt.site \
--to=oneukum@suse.de \
--cc=JBottomley@parallels.com \
--cc=aliakc@web.de \
--cc=dc395x@twibble.org \
--cc=g.liakhovetski@gmx.de \
--cc=lenehan@twibble.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rickard_strandqvist@spectrumdigital.se \
/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®