Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: AnandKumar.Santhanam@pmcs.com
Cc: linux-scsi@vger.kernel.org
Subject: re: [SCSI] pm80xx: Print SAS address of IO failed device.
Date: Fri, 1 Nov 2013 13:29:11 +0300	[thread overview]
Message-ID: <20131101102911.GJ29795@longonot.mountain> (raw)

Hello Anand Kumar Santhanam,

This is a semi-automatic email about new static checker warnings.

The patch cb269c26ed02: "[SCSI] pm80xx: Print SAS address of IO 
failed device." from Sep 17, 2013, leads to the following Smatch 
complaint:

drivers/scsi/pm8001/pm8001_hwi.c:2343 mpi_sata_completion()
	 error: we previously assumed 't->dev' could be null (see line 2319)

drivers/scsi/pm8001/pm8001_hwi.c
  2318		if (t) {
  2319			if (t->dev && (t->dev->lldd_dev))
                            ^^^^^
Exisiting check.

  2320				pm8001_dev = t->dev->lldd_dev;
  2321		} else {
  2322			PM8001_FAIL_DBG(pm8001_ha,
  2323				pm8001_printk("task null\n"));
  2324			return;
  2325		}
  2326	
  2327		if ((pm8001_dev && !(pm8001_dev->id & NCQ_READ_LOG_FLAG))
  2328			&& unlikely(!t || !t->lldd_task || !t->dev)) {
                                                           ^^^^^^^
Existing check.

  2329			PM8001_FAIL_DBG(pm8001_ha,
  2330				pm8001_printk("task or dev null\n"));
  2331			return;
  2332		}
  2333	
  2334		ts = &t->task_status;
  2335		if (!ts) {
  2336			PM8001_FAIL_DBG(pm8001_ha,
  2337				pm8001_printk("ts null\n"));
  2338			return;
  2339		}
  2340		/* Print sas address of IO failed device */
  2341		if ((status != IO_SUCCESS) && (status != IO_OVERFLOW) &&
  2342			(status != IO_UNDERFLOW)) {
  2343			if (!((t->dev->parent) &&
                               ^^^^^^^^
Patch introduces new unchecked dereference.

  2344				(DEV_IS_EXPANDER(t->dev->parent->dev_type)))) {
  2345				for (i = 0 , j = 4; j <= 7 && i <= 3; i++ , j++)

regards,
dan carpenter

             reply	other threads:[~2013-11-01 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 10:29 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-11-01 10:29 [SCSI] pm80xx: Print SAS address of IO failed device Dan Carpenter

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=20131101102911.GJ29795@longonot.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=AnandKumar.Santhanam@pmcs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox