diff options
author | Suraj Jitindar Singh <sjitindarsingh@gmail.com> | 2016-06-28 14:20:53 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-06-30 15:55:10 +1000 |
commit | e46199974cca896f8012743eaad3cae140aba5a9 (patch) | |
tree | 111ed747b2c0901cd5526beef830cccf5e61e7d6 /include | |
parent | 44bdc5cdfab0bceb4e2c7eadb0deebf455daefc3 (diff) | |
download | skiboot-e46199974cca896f8012743eaad3cae140aba5a9.zip skiboot-e46199974cca896f8012743eaad3cae140aba5a9.tar.gz skiboot-e46199974cca896f8012743eaad3cae140aba5a9.tar.bz2 |
fsp/op-panel: Fix out of bounds array access and #define display dimensions
In the function __opal_write_oppanel() coverity complains about an out
of bounds array access. While the pointer is never actually dereferenced,
this isn't immediately obvious from the code. Additionally the number and
length of the lines on the operator panel display are hard coded into
the function. While we are here we might as well move these into a #define
statement.
Rework the code in __opal_write_oppanel() where the message is copied into
the buffer so that coverity won't complain about an out of bounds array
access and so that it is line number and length agnostic (now relying on
the #defined values).
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/op-panel.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/op-panel.h b/include/op-panel.h index dfb4e11..6a935b8 100644 --- a/include/op-panel.h +++ b/include/op-panel.h @@ -19,6 +19,10 @@ #include <stdint.h> +/* Operator Panel Dimensions */ +#define OP_PANEL_NUM_LINES 2 +#define OP_PANEL_LINE_LEN 16 + /* Severity */ enum op_severity { OP_LOG = 0x4342, /* 'CB' - Progress info */ |