Skip to content

Commit a524287

Browse files
Pei Xiaorafaeljw
authored andcommitted
ACPICA: check null return of ACPI_ALLOCATE_ZEROED() in acpi_db_convert_to_package()
ACPICA commit 4d4547cf13cca820ff7e0f859ba83e1a610b9fd0 ACPI_ALLOCATE_ZEROED() may fail, elements might be NULL and will cause NULL pointer dereference later. Link: acpica/acpica@4d4547cf Signed-off-by: Pei Xiao <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 8400291 commit a524287

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/acpi/acpica/dbconvert.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object)
174174
elements =
175175
ACPI_ALLOCATE_ZEROED(DB_DEFAULT_PKG_ELEMENTS *
176176
sizeof(union acpi_object));
177+
if (!elements)
178+
return (AE_NO_MEMORY);
177179

178180
this = string;
179181
for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++) {

0 commit comments

Comments
 (0)