aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-05-17 08:40:02 -0700
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-05-17 18:49:27 +0200
commit016d8f75d8aa53efad250f034c55ea8454390e99 (patch)
treef06a1d27adbdad1519876085a91fae5b92b457be /src/drivers/intel/fsp2_0
parent451b1e0b9d1813b08731c5d4e6e2a2e752a8be2a (diff)
drivers/intel/fsp2_0: Fix array indexing error
Don't allow an array index of 2 to be processed by the code referencing the array. Found-by: Coverity CID 1353337 TEST=None Change-Id: I586ca14416a6e40971f8f6f4066fbdb4908ca688 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/14868 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/drivers/intel/fsp2_0')
-rw-r--r--src/drivers/intel/fsp2_0/graphics.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/intel/fsp2_0/graphics.c b/src/drivers/intel/fsp2_0/graphics.c
index 1480179eaa..f4ba40220f 100644
--- a/src/drivers/intel/fsp2_0/graphics.c
+++ b/src/drivers/intel/fsp2_0/graphics.c
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Intel Corp.
+ * Copyright (C) 2015 - 2016 Intel Corp.
* (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.)
*
* This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,7 @@ enum cb_err fsp_fill_lb_framebuffer(struct lb_framebuffer *framebuffer)
return CB_ERR;
}
- if (ginfo->pixel_format > ARRAY_SIZE(fsp_framebuffer_format_map)) {
+ if (ginfo->pixel_format >= ARRAY_SIZE(fsp_framebuffer_format_map)) {
printk(BIOS_ALERT, "FSP set unknown framebuffer format: %d\n",
ginfo->pixel_format);
return CB_ERR;