Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: brking@linux.vnet.ibm.com
Cc: linux-scsi@vger.kernel.org
Subject: re: [SCSI] ipr: Increase max concurrent oustanding commands
Date: Mon, 23 Feb 2015 15:32:30 +0300	[thread overview]
Message-ID: <20150223123230.GA7141@mwanda> (raw)

Hello Brian King,

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

The patch 89aad4283173: "[SCSI] ipr: Increase max concurrent
oustanding commands" from Mar 14, 2012, leads to the following Smatch
complaint:

drivers/scsi/ipr.c:9038 ipr_alloc_cmd_blks()
	 error: we previously assumed 'ioa_cfg->ipr_cmnd_list' could be null (see line 9037)

drivers/scsi/ipr.c
  9036	
  9037		if (!ioa_cfg->ipr_cmnd_list || !ioa_cfg->ipr_cmnd_list_dma) {
                     ^^^^^^^^^^^^^^^^^^^^^^
This can be NULL.

  9038			ipr_free_cmd_blks(ioa_cfg);
                                          ^^^^^^^
But we dereference it unconditionally inside the ipr_free_cmd_blks()
function when we check: "if (ioa_cfg->ipr_cmnd_list[i])".  These kinds
of magic free everything functions are almost always buggy but Smatch
missed this bug initialy and I had to update it.  I'll push the Smatch
change later this week.  It requires the cross function database to
trigger this warning.

  9039			return -ENOMEM;
  9040		}

regards,
dan carpenter

             reply	other threads:[~2015-02-23 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 12:32 Dan Carpenter [this message]
2015-02-23 14:29 ` [SCSI] ipr: Increase max concurrent oustanding commands Brian King

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=20150223123230.GA7141@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=brking@linux.vnet.ibm.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