From: Christoph Hellwig <hch@infradead.org>
To: Joe Lawrence <joe.lawrence@stratus.com>
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
Subject: Re: [PATCH 7/7] mptfusion: tweak null pointer checks
Date: Thu, 5 Jun 2014 02:44:57 -0700 [thread overview]
Message-ID: <20140605094457.GH727@infradead.org> (raw)
In-Reply-To: <1401900747-19894-1-git-send-email-joe.lawrence@stratus.com>
> JL: Comments on the above warnings, in order:
Can you move these comments into the actual commit message instead of
the part that gets discarded?
>
> No-brainer, the enclosing switch statement dereferences 'reply',
> so we can't get here unless 'reply' is valid.
ok.
> "Retry target reset" needs to know the target ID and channel, so
> enclose that entire block inside a if (pScsiTmReply) block.
Reading the code in mptsas_taskmgmt_complete it's pretty obvious
that it can't do anything useful if mr/pScsiTmReply are NULL, so I
suspect it would be best to just return at the beginning of the
function.
I'd love to understand if it actually could ever be zero, which I doubt.
Maybe the LSI people can shed some light on that?
> The code before the loop checks for 'port_info->phy_info', but not
> many other places in the driver bother. Not sure what to do here.
It's pretty obvious from reading mptsas_sas_io_unit_pg0 that we never
register a port_info with a NULL phy_info in the lists, so all NULL
checks on it could be deleted.
> 'hostdata' is checked and then immediately dereferenced after
> that block. How about a default return string of "N/A" to indicate
> one isn't available?
shost_priv can't return NULL, so the if (h) should be removed.
> Not sure what to do here. 'vdevice' is needed to "set up the
> message frame" target ID and channel, so it should probably return
> an error in in this case.
vdevice can't ever be NULL here, it's allocated in ->slave_alloc and
thus guaranteed to be around when ->queuecommand is called.
next prev parent reply other threads:[~2014-06-05 9:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 16:49 [PATCH 0/7] mptfusion static checker fixups Joe Lawrence
2014-06-04 16:49 ` [PATCH 1/7] mptfusion: mark file-private functions as static Joe Lawrence
2014-06-05 9:24 ` Christoph Hellwig
2014-06-04 16:49 ` [PATCH 2/7] mptfusion: remove redundant kfree checks Joe Lawrence
2014-06-05 9:24 ` Christoph Hellwig
2014-06-04 16:49 ` [PATCH 3/7] mptfusion: initChainBuffers should return errno Joe Lawrence
2014-06-05 9:27 ` Christoph Hellwig
2014-06-04 16:49 ` [PATCH 4/7] mptfusion: zero kernel-space source of copy_to_user Joe Lawrence
2014-06-04 16:58 ` Joe Lawrence
2014-06-05 9:29 ` Christoph Hellwig
2014-06-06 8:31 ` Dan Carpenter
2014-06-04 16:51 ` [PATCH 5/7] mptfusion: make adapter prod_name[] a pointer Joe Lawrence
2014-06-05 9:31 ` Christoph Hellwig
2014-06-04 16:52 ` [PATCH 6/7] mptfusion: combine fw_event_work and its event_data Joe Lawrence
2014-06-05 9:34 ` Christoph Hellwig
2014-06-06 21:56 ` Joe Lawrence
2014-06-04 16:52 ` [PATCH 7/7] mptfusion: tweak null pointer checks Joe Lawrence
2014-06-05 9:44 ` Christoph Hellwig [this message]
2014-06-25 11:01 ` [PATCH 0/7] mptfusion static checker fixups Christoph Hellwig
2014-06-25 14:18 ` Joe Lawrence
2014-06-25 14:18 ` Christoph Hellwig
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=20140605094457.GH727@infradead.org \
--to=hch@infradead.org \
--cc=Sreekanth.Reddy@lsi.com \
--cc=dan.carpenter@oracle.com \
--cc=joe.lawrence@stratus.com \
--cc=linux-scsi@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.