All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH] scsi_common: do not clobber fixed sense information
Date: Fri, 18 Mar 2016 09:19:26 -0700	[thread overview]
Message-ID: <56EC2A8E.1010005@sandisk.com> (raw)
In-Reply-To: <1458288095-126497-1-git-send-email-hare@suse.de>

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 <hare@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;

Hello Hannes,

Please Cc stable for this patch.

Are you aware that the explicit cast to u32 can be left out? Without 
that cast the compiler implicitly performs casting from u64 to u32.

Anyway:

Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>


      parent reply	other threads:[~2016-03-18 16:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18  8:01 [PATCH] scsi_common: do not clobber fixed sense information Hannes Reinecke
2016-03-18 12:57 ` Ewan D. Milne
2016-03-18 16:02 ` Lee Duncan
2016-03-18 16:19 ` Bart Van Assche [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56EC2A8E.1010005@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=hare@suse.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.