On Thu, 2014-07-31 at 12:10 +0300, Dan Carpenter wrote:
> [ This is not really a new bug, it's just that renaming the function
>   made it show up as a new bug and I figured maybe you know what's going
>   on since you are working with related code.  -dan ]
> 
> Hello Douglas Gilbert,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch cbf67842c3d9: "scsi_debug: support scsi-mq, queues and 
> locks" from Jul 26, 2014, leads to the following Smatch complaint:
> 
> drivers/scsi/scsi_debug.c:4153 scsi_debug_queuecommand()
>        error: we previously assumed 'cmd' could be null (see line 4106)
> 
> drivers/scsi/scsi_debug.c
>   4105                if ((SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) &&
>   4106                    !(SCSI_DEBUG_OPT_NO_CDB_NOISE & scsi_debug_opts) && 
> cmd) {
>                                                                         ^^^
> Check.

This check is bogus.  cmd comes from

int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t
done)
{
        unsigned char *cmd = (unsigned char *) SCpnt->cmnd;

which can never be NULL (cast is pointless as well, it's already an
unsigned char *).

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to