From patchwork Fri Nov 10 19:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Kiryushin X-Patchwork-Id: 742864 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C395238DC1 for ; Fri, 10 Nov 2023 19:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from relay161.nicmail.ru (relay161.nicmail.ru [91.189.117.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 003FB6A48; Fri, 10 Nov 2023 11:45:24 -0800 (PST) Received: from [10.28.138.149] (port=40524 helo=[192.168.95.111]) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1r1XRP-0007NN-6C; Fri, 10 Nov 2023 22:45:20 +0300 Received: from [87.245.155.195] (account kiryushin@ancud.ru HELO [192.168.95.111]) by incarp1102.mail.hosting.nic.ru (Exim 5.55) with id 1r1XRP-00H8mB-2j; Fri, 10 Nov 2023 22:45:19 +0300 Message-ID: Date: Fri, 10 Nov 2023 22:45:19 +0300 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Nikita Kiryushin Subject: [PATCH] ACPI: OSL: Initialize output value To: "Rafael J. Wysocki" Cc: Len Brown , Lin Ming , Bob Moore , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Content-Language: en-US X-MS-Exchange-Organization-SCL: -1 Buffer variable for result (value32) is not initialized. This can lead to unexpected behavior, if underlying platform-specific raw_pci_read fails to report error (uninitialized value will be treated as valid pci-read result), or exposition of unexpected data to PCI config space reader. Zeroing of buffer value addresses the later problem and makes the behavior in the former case somewhat more predictable. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c5f0231ee6b0 ("ACPICA: Fix acpi_os_read_pci_configuration prototype") Signed-off-by: Nikita Kiryushin --- drivers/acpi/osl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index c09cc3c68633..d3c0f7f01a29 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -788,7 +788,7 @@ acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, u32 reg, u64 *value, u32 width) { int result, size; - u32 value32; + u32 value32 = 0U; if (!value) return AE_BAD_PARAMETER;