[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1622545553-19160-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Tue, 1 Jun 2021 19:05:53 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: keescook@...omium.org
Cc: anton@...msg.org, ccross@...roid.com, tony.luck@...el.com,
james.morse@....com, bp@...en8.de, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] ACPI: APEI: ERST: Fix missing error code in erst_init()
The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'rc'.
Eliminate the follow smatch warning:
drivers/acpi/apei/erst.c:1114 erst_init() warn: missing error code 'rc'.
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
drivers/acpi/apei/erst.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 242f3c2..492d499 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -1110,9 +1110,10 @@ static int __init erst_init(void)
status = acpi_get_table(ACPI_SIG_ERST, 0,
(struct acpi_table_header **)&erst_tab);
- if (status == AE_NOT_FOUND)
+ if (status == AE_NOT_FOUND) {
+ rc = -EINVAL;
goto err;
- else if (ACPI_FAILURE(status)) {
+ } else if (ACPI_FAILURE(status)) {
const char *msg = acpi_format_exception(status);
pr_err("Failed to get table, %s\n", msg);
rc = -EINVAL;
--
1.8.3.1
Powered by blists - more mailing lists