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: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
4d7d39a18b
commit
148cff67b4
|
@ -137,11 +137,11 @@ EXPORT_SYMBOL(int_to_scsilun);
|
|||
bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
|
||||
struct scsi_sense_hdr *sshdr)
|
||||
{
|
||||
memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
|
||||
|
||||
if (!sense_buffer || !sb_len)
|
||||
return false;
|
||||
|
||||
memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
|
||||
|
||||
sshdr->response_code = (sense_buffer[0] & 0x7f);
|
||||
|
||||
if (!scsi_sense_valid(sshdr))
|
||||
|
|
Loading…
Reference in New Issue