RE: [scsi 1/2] scsi_debug: schedule_resp fix input variable check

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

 



> > @@ -3947,11 +3947,18 @@ schedule_resp(struct scsi_cmnd *cmnd, struct
> sdebug_dev_info *devip,
> >   	struct sdebug_queued_cmd *sqcp = NULL;
> >   	struct scsi_device *sdp = cmnd->device;
> 
> This patch seems incorrect because it still dereferences
> cmnd (in the above line) before it checks it for NULL.
>
Opps, haven't sent the lastest version. 

> > -	if (NULL == cmnd || NULL == devip) {
> > -		pr_warn("called with NULL cmnd or devip pointer\n");
> > +	/* this should never happend */
> 
> happen?
Thanks

> 
> The scsi_debug driver was written by Eric Youngdale to test
> the original Linux SCSI subsystem (or a subsequent rewrite
> of same). Remnants of its "trust nobody" style remain and
> may have been of use to more recent tinkerers.	

The check is preserved  with bigger warning,   there is just no single call for this function w/ cmnd == NULL.
> 
> > +	if (WARN_ON(!cmnd))
> > +		return SCSI_MLQUEUE_HOST_BUSY;
> > +



--
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