summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorvoid0red <30990023+void0red@users.noreply.github.com>2023-04-05 16:57:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-24 19:32:35 +0300
commitfee6133490091492dc66bcf71479bd53bd17a7d2 (patch)
tree04475f609ba7acafa91eec85f01780ddf612939e /drivers
parent8c4a7163b7f1495e3cc58bec7a4100de6612cde9 (diff)
downloadlinux-fee6133490091492dc66bcf71479bd53bd17a7d2.tar.xz
ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
[ Upstream commit ae5a0eccc85fc960834dd66e3befc2728284b86c ] ACPICA commit 0d5f467d6a0ba852ea3aad68663cbcbd43300fd4 ACPI_ALLOCATE_ZEROED may fails, object_info might be null and will cause null pointer dereference later. Link: https://github.com/acpica/acpica/commit/0d5f467d Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpica/dbnames.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c
index 3615e1a6efd8..b91155ea9c34 100644
--- a/drivers/acpi/acpica/dbnames.c
+++ b/drivers/acpi/acpica/dbnames.c
@@ -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,