On 03/18/2016 01:01 AM, Hannes Reinecke wrote:
> For fixed sense the information field is 32 bits, to we need
> to truncate the information field to avoid clobbering the
> sense code.
> 
> Signed-off-by: Hannes Reinecke <h...@suse.com>
> ---
>  drivers/scsi/scsi_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> index c126966..3459009 100644
> --- a/drivers/scsi/scsi_common.c
> +++ b/drivers/scsi/scsi_common.c
> @@ -279,7 +279,7 @@ int scsi_set_sense_information(u8 *buf, int buf_len, u64 
> info)
>               put_unaligned_be64(info, &ucp[4]);
>       } else if ((buf[0] & 0x7f) == 0x70) {
>               buf[0] |= 0x80;
> -             put_unaligned_be64(info, &buf[3]);
> +             put_unaligned_be32((u32)info, &buf[3]);
>       }
>  
>       return 0;
> 

Reviewed-by: Lee Duncan <ldun...@suse.com>

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