ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
Subsystems (2)
PATCH 1/1 ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
ACPI_ALLOCATE_ZEROED may fails, object_info might be null and will cause null pointer dereference later.
--- drivers/acpi/acpica/dbnames.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/acpica/dbnames.c +3 -0
@@ -652,6 +652,9 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg) object_info =ACPI_ALLOCATE_ZEROED (sizeof (struct acpi_object_info )); +if (!object_info) +return (AE_NO_MEMORY ); +/* Walk the namespace from the root */ (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
Signature · 1 line
2.34.1
Rafael J. Wysocki
maintainerQuoted 5 lines · Kang Chen
ACPI_ALLOCATE_ZEROEDmay fails,object_infomight be null and will cause null pointer dereference later.Signed-off-by Kang Chen <[email protected]>
As a rule, ACPICA changes need to be submitted as pull requests to the upstream ACPICA project on GitHub in the first place.
When this happens, please resend the patch with a Link tag pointing to the corresponding upstream pull request.
Quoted 21 lines
--- drivers/acpi/acpica/dbnames.c | 3 +++ 1 file changed, 3 insertions(+)drivers/acpi/acpica/dbnames.c +3
-1@@ -652,6 +652,9 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg) object_info =ACPI_ALLOCATE_ZEROED (sizeof (struct acpi_object_info )); +if (!object_info) +return (AE_NO_MEMORY ); +/* Walk the namespace from the root */ (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, --2.34.1
PATCH v2 1/1 ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
From: Kang Chen <[email protected]>
ACPI_ALLOCATE_ZEROED may fails, object_info might be null and will cause null pointer dereference later.
---
v2 -> v1: add a github link
drivers/acpi/acpica/dbnames.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/acpica/dbnames.c +3 -0
@@ -652,6 +652,9 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg) object_info =ACPI_ALLOCATE_ZEROED (sizeof (struct acpi_object_info )); +if (!object_info) +return (AE_NO_MEMORY ); +/* Walk the namespace from the root */ (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
Signature · 1 line
2.34.1