All of lore.kernel.org
 help / color / mirror / Atom feed
* re: [SCSI] ipr: Increase max concurrent oustanding commands
@ 2015-02-23 12:32 Dan Carpenter
  2015-02-23 14:29 ` Brian King
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-02-23 12:32 UTC (permalink / raw)
  To: brking; +Cc: linux-scsi

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-23 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 12:32 [SCSI] ipr: Increase max concurrent oustanding commands Dan Carpenter
2015-02-23 14:29 ` Brian King

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.