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 /drivers/acpi/utilities/utmisc.c | |
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>
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 14 |
1 files changed, 5 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 | ||