summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 2e02314..3c18ea6 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -169,7 +169,7 @@ int blk_status_to_errno(blk_status_t status)
{
int idx = (__force int)status;
- if (WARN_ON_ONCE(idx > ARRAY_SIZE(blk_errors)))
+ if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors)))
return -EIO;
return blk_errors[idx].errno;
}
@@ -179,7 +179,7 @@ static void print_req_error(struct request *req, blk_status_t status)
{
int idx = (__force int)status;
- if (WARN_ON_ONCE(idx > ARRAY_SIZE(blk_errors)))
+ if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors)))
return;
printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu\n",
OpenPOWER on IntegriCloud