Re: scsi_debug: support scsi-mq, queues and locks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux