diff options
author | Bob Moore <robert.moore@intel.com> | 2008-06-10 00:53:01 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:03 -0400 |
commit | 11f2a61ab418305167f9a3f3a31a50449222f64b (patch) | |
tree | 83a56046d08afc5c68ffd06d3e7970366067545a | |
parent | 6719561f9b4281491f58ed9f0bbc179dc7db95b7 (diff) |
ACPICA: Fix possible negative array index in acpi_ut_validate_exception
Added NULL fields to the exception string arrays to eliminate
the -1 subtraction on the SubStatus field.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 14 | ||||
-rw-r--r-- | include/acpi/acexcep.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index 1f057b71db1a..47354d9b0e56 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("utmisc") | |||
64 | ******************************************************************************/ | 64 | ******************************************************************************/ |
65 | const char *acpi_ut_validate_exception(acpi_status status) | 65 | const char *acpi_ut_validate_exception(acpi_status status) |
66 | { | 66 | { |
67 | acpi_status sub_status; | 67 | u32 sub_status; |
68 | const char *exception = NULL; | 68 | const char *exception = NULL; |
69 | 69 | ||
70 | ACPI_FUNCTION_ENTRY(); | 70 | ACPI_FUNCTION_ENTRY(); |
@@ -85,32 +85,28 @@ const char *acpi_ut_validate_exception(acpi_status status) | |||
85 | case AE_CODE_PROGRAMMER: | 85 | case AE_CODE_PROGRAMMER: |
86 | 86 | ||
87 | if (sub_status <= AE_CODE_PGM_MAX) { | 87 | if (sub_status <= AE_CODE_PGM_MAX) { |
88 | exception = | 88 | exception = acpi_gbl_exception_names_pgm[sub_status]; |
89 | acpi_gbl_exception_names_pgm[sub_status - 1]; | ||
90 | } | 89 | } |
91 | break; | 90 | break; |
92 | 91 | ||
93 | case AE_CODE_ACPI_TABLES: | 92 | case AE_CODE_ACPI_TABLES: |
94 | 93 | ||
95 | if (sub_status <= AE_CODE_TBL_MAX) { | 94 | if (sub_status <= AE_CODE_TBL_MAX) { |
96 | exception = | 95 | exception = acpi_gbl_exception_names_tbl[sub_status]; |
97 | acpi_gbl_exception_names_tbl[sub_status - 1]; | ||
98 | } | 96 | } |
99 | break; | 97 | break; |
100 | 98 | ||
101 | case AE_CODE_AML: | 99 | case AE_CODE_AML: |
102 | 100 | ||
103 | if (sub_status <= AE_CODE_AML_MAX) { | 101 | if (sub_status <= AE_CODE_AML_MAX) { |
104 | exception = | 102 | exception = acpi_gbl_exception_names_aml[sub_status]; |
105 | acpi_gbl_exception_names_aml[sub_status - 1]; | ||
106 | } | 103 | } |
107 | break; | 104 | break; |
108 | 105 | ||
109 | case AE_CODE_CONTROL: | 106 | case AE_CODE_CONTROL: |
110 | 107 | ||
111 | if (sub_status <= AE_CODE_CTRL_MAX) { | 108 | if (sub_status <= AE_CODE_CTRL_MAX) { |
112 | exception = | 109 | exception = acpi_gbl_exception_names_ctrl[sub_status]; |
113 | acpi_gbl_exception_names_ctrl[sub_status - 1]; | ||
114 | } | 110 | } |
115 | break; | 111 | break; |
116 | 112 | ||
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index ea627ed2420d..e5a890ffeb02 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -226,6 +226,7 @@ char const *acpi_gbl_exception_names_env[] = { | |||
226 | }; | 226 | }; |
227 | 227 | ||
228 | char const *acpi_gbl_exception_names_pgm[] = { | 228 | char const *acpi_gbl_exception_names_pgm[] = { |
229 | NULL, | ||
229 | "AE_BAD_PARAMETER", | 230 | "AE_BAD_PARAMETER", |
230 | "AE_BAD_CHARACTER", | 231 | "AE_BAD_CHARACTER", |
231 | "AE_BAD_PATHNAME", | 232 | "AE_BAD_PATHNAME", |
@@ -239,6 +240,7 @@ char const *acpi_gbl_exception_names_pgm[] = { | |||
239 | }; | 240 | }; |
240 | 241 | ||
241 | char const *acpi_gbl_exception_names_tbl[] = { | 242 | char const *acpi_gbl_exception_names_tbl[] = { |
243 | NULL, | ||
242 | "AE_BAD_SIGNATURE", | 244 | "AE_BAD_SIGNATURE", |
243 | "AE_BAD_HEADER", | 245 | "AE_BAD_HEADER", |
244 | "AE_BAD_CHECKSUM", | 246 | "AE_BAD_CHECKSUM", |
@@ -248,6 +250,7 @@ char const *acpi_gbl_exception_names_tbl[] = { | |||
248 | }; | 250 | }; |
249 | 251 | ||
250 | char const *acpi_gbl_exception_names_aml[] = { | 252 | char const *acpi_gbl_exception_names_aml[] = { |
253 | NULL, | ||
251 | "AE_AML_ERROR", | 254 | "AE_AML_ERROR", |
252 | "AE_AML_PARSE", | 255 | "AE_AML_PARSE", |
253 | "AE_AML_BAD_OPCODE", | 256 | "AE_AML_BAD_OPCODE", |
@@ -285,6 +288,7 @@ char const *acpi_gbl_exception_names_aml[] = { | |||
285 | }; | 288 | }; |
286 | 289 | ||
287 | char const *acpi_gbl_exception_names_ctrl[] = { | 290 | char const *acpi_gbl_exception_names_ctrl[] = { |
291 | NULL, | ||
288 | "AE_CTRL_RETURN_VALUE", | 292 | "AE_CTRL_RETURN_VALUE", |
289 | "AE_CTRL_PENDING", | 293 | "AE_CTRL_PENDING", |
290 | "AE_CTRL_TERMINATE", | 294 | "AE_CTRL_TERMINATE", |