Re: [PATCH] scsi: sd: fix uninit access of sshdr

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

 



On 2019-10-18 03:01, zhengbin wrote:
> @@ -1648,16 +1651,20 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)
>  	if (res) {
>  		sd_print_result(sdkp, "Synchronize Cache(10) failed", res);
> 
> -		if (driver_byte(res) == DRIVER_SENSE)
> +		/* we need to evaluate the error return  */
> +		if (driver_byte(res) == DRIVER_SENSE &&
> +		    scsi_sense_valid(sshdr)) {
>  			sd_print_sense_hdr(sdkp, sshdr);
> 

Does Hannes' comment about DRIVER_SENSE also apply to this patch?

Thanks,

Bart.



[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