From patchwork Fri Oct 11 21:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 1996299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XQKmR2Hyvz1xvg for ; Sat, 12 Oct 2024 08:40:22 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1szNMt-00083q-FI; Fri, 11 Oct 2024 21:40:15 +0000 Received: from mout.gmx.net ([212.227.15.18]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1szNMr-00083f-Lt for fwts-devel@lists.ubuntu.com; Fri, 11 Oct 2024 21:40:13 +0000 X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N4QsO-1u0aew0CZy-012Cw7; Fri, 11 Oct 2024 23:40:12 +0200 From: Armin Wolf To: ivan.hu@canonical.com Subject: [PATCH v2 1/2] lib: fwts_acpi_object_eval: Do not return FWTS_OK if method lookup fails Date: Fri, 11 Oct 2024 23:40:08 +0200 Message-Id: <20241011214009.28540-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.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22vxvIjdcFXaG6umkfX8kyAyHlAmTulTaMkrZtWpUwAqmA9+L19KHj4ER5WR 6z64ydPnOsFlMwIWKy92U/vQ== Received-SPF: pass client-ip=212.227.15.18; envelope-from=W_Armin@gmx.de; helo=mout.gmx.net X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fwts-devel@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" If for some reason the lookup of an ACPI method fails with an error different than AE_NOT_FOUND, FWTS_OK is returned. Fix this by instead returning FWTS_ERROR in such cases. Signed-off-by: Armin Wolf Acked-by: Ivan Hu --- src/lib/src/fwts_acpi_object_eval.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.39.5 diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c index 37f67eb8..1c2de735 100644 --- a/src/lib/src/fwts_acpi_object_eval.c +++ b/src/lib/src/fwts_acpi_object_eval.c @@ -1222,6 +1222,13 @@ int fwts_evaluate_method(fwts_framework *fw, } } + if (ACPI_FAILURE(status)) { + const char *exception = AcpiFormatException(status); + fwts_log_info(fw, "ACPICA Exception %s during lookup of method %s", + exception, name); + return FWTS_ERROR; + } + return FWTS_OK; }