scsi: fix upper bounds check of sense key in scsi_sense_key_string()
commit a87eeb900dbb9f8202f96604d56e47e67c936b9d upstream. Commit655ee63cf3
("scsi constants: command, sense key + additional sense string") added a "Completed" sense string with key 0xF to snstext[], but failed to updated the upper bounds check of the sense key in scsi_sense_key_string(). Fixes:655ee63cf3
("[SCSI] scsi constants: command, sense key + additional sense strings") Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f5b004e4ed
commit
6f0caecda5
1 changed files with 3 additions and 2 deletions
|
@ -1181,8 +1181,9 @@ static const char * const snstext[] = {
|
|||
|
||||
/* Get sense key string or NULL if not available */
|
||||
const char *
|
||||
scsi_sense_key_string(unsigned char key) {
|
||||
if (key <= 0xE)
|
||||
scsi_sense_key_string(unsigned char key)
|
||||
{
|
||||
if (key < ARRAY_SIZE(snstext))
|
||||
return snstext[key];
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue