Re: [PATCH] virtio_scsi: check on resp->sense_len instead of 'sense_buffer'

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

 



Il 18/07/2014 16:57, Ming Lei ha scritto:
> -	if (sc->sense_buffer) {
> +	if (resp->sense_len) {

In the (unlikely) case that sc->sense_buffer == NULL, you'd pass a NULL
to memcpy.

If you want, you can change this if to

	if (sc->sense_buffer && resp->sense_len)

but frankly it seems like slightly pointless churn to me.

Paolo

>  		memcpy(sc->sense_buffer, resp->sense,
>  		       min_t(u32, resp->sense_len, VIRTIO_SCSI_SENSE_SIZE));
> -		if (resp->sense_len)
> -			set_driver_byte(sc, DRIVER_SENSE);
> +		set_driver_byte(sc, DRIVER_SENSE);
>  	}


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