From: Dan Carpenter <dan.carpenter@oracle.com>
To: fthain@telegraphics.com.au
Cc: linux-scsi@vger.kernel.org
Subject: re: ncr5380: Implement new eh_bus_reset_handler
Date: Tue, 19 Jan 2016 12:31:40 +0300 [thread overview]
Message-ID: <20160119093140.GA22738@mwanda> (raw)
Hello Finn Thain,
The patch 62717f537e1b: "ncr5380: Implement new eh_bus_reset_handler"
from Jan 3, 2016, leads to the following static checker warning:
drivers/scsi/NCR5380.c:2476 NCR5380_bus_reset()
error: potential NULL dereference 'hostdata->connected'.
drivers/scsi/NCR5380.c
2468
2469 if (hostdata->connected) {
^^^^^^^^^^^^^^^^^^^
2470 set_host_byte(hostdata->connected, DID_RESET);
2471 complete_cmd(instance, hostdata->connected);
2472 hostdata->connected = NULL;
^^^^^^^^^^^^^^^^^^^^^^^^^^^
->connected is NULL because it either starts as NULL or we set it to
NULL.
2473 }
2474
2475 if (hostdata->sensing) {
2476 set_host_byte(hostdata->connected, DID_RESET);
^^^^^^^^^^^^^^^^^^^
It leads to a NULL dereference here.
2477 complete_cmd(instance, hostdata->sensing);
2478 hostdata->sensing = NULL;
2479 }
2480
2481 for (i = 0; i < 8; ++i)
2482 hostdata->busy[i] = 0;
regards,
dan carpenter
reply other threads:[~2016-01-20 4:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20160119093140.GA22738@mwanda \
--to=dan.carpenter@oracle.com \
--cc=fthain@telegraphics.com.au \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).