From 5b465b045af3a649a89b8a5c5bfdece20ffc0345 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sat, 17 Sep 2016 02:25:44 -0300 Subject: Linux-libre 4.7.4-gnu --- drivers/scsi/constants.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index 83458f7a2..6dc96c8df 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c @@ -361,8 +361,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; } -- cgit v1.2.3-54-g00ecf