Skip to content

Commit 35d7a63

Browse files
Pei XiaosfX-bot
Pei Xiao
authored andcommitted
ACPICA: check null return of ACPI_ALLOCATE_ZEROED() in acpi_db_convert_to_package()
[ Upstream commit a5242874488eba2b9062985bf13743c029821330 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent fcf429c commit 35d7a63

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
@@ -206,6 +206,8 @@ acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object)
206206
elements =
207207
ACPI_ALLOCATE_ZEROED(DB_DEFAULT_PKG_ELEMENTS *
208208
sizeof(union acpi_object));
209+
if (!elements)
210+
return (AE_NO_MEMORY);
209211

210212
this = string;
211213
for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++) {

0 commit comments

Comments
 (0)