Commit 148cff67 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: always zero sshdr in scsi_normalize_sense

This gives us a clear state even if a command didn't return sense data.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4d7d39a1
...@@ -137,11 +137,11 @@ EXPORT_SYMBOL(int_to_scsilun); ...@@ -137,11 +137,11 @@ EXPORT_SYMBOL(int_to_scsilun);
bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len, bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
struct scsi_sense_hdr *sshdr) struct scsi_sense_hdr *sshdr)
{ {
memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
if (!sense_buffer || !sb_len) if (!sense_buffer || !sb_len)
return false; return false;
memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
sshdr->response_code = (sense_buffer[0] & 0x7f); sshdr->response_code = (sense_buffer[0] & 0x7f);
if (!scsi_sense_valid(sshdr)) if (!scsi_sense_valid(sshdr))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment