lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 28 Aug 2022 13:51:20 -0700
From:   Li Zhong <floridsleeves@...il.com>
To:     linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Cc:     rafael@...nel.org, lenb@...nel.org, mario.limonciello@....com,
        hdegoede@...hat.com, Shyam-sundar.S-k@....com,
        mika.westerberg@...ux.intel.com, nakato@...ato.io,
        lily <floridsleeves@...il.com>
Subject: [PATCH v1] drivers/acpi/x86: check return null pointer from acpi_evaluate_dsm()

From: lily <floridsleeves@...il.com>

Check return value from acpi_evaluate_dsm(). Only do ACPI_FREE() when
out_obj is not NULL pointers.

Signed-off-by: Li Zhong <floridsleeves@...il.com>
---
 drivers/acpi/x86/s2idle.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index f9ac12b778e6..1b449d3cfbf7 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -328,7 +328,8 @@ static void acpi_sleep_run_lps0_dsm(unsigned int func, unsigned int func_mask, g
 
 	out_obj = acpi_evaluate_dsm(lps0_device_handle, &dsm_guid,
 					rev_id, func, NULL);
-	ACPI_FREE(out_obj);
+	if (!out_obj)
+		ACPI_FREE(out_obj);
 
 	acpi_handle_debug(lps0_device_handle, "_DSM function %u evaluation %s\n",
 			  func, out_obj ? "successful" : "failed");
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ