From patchwork Wed Sep 16 14:57:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Wallner X-Patchwork-Id: 1365397 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=br-automation.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bs3BG2lTcz9sPB for ; Thu, 17 Sep 2020 00:58:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35E3D82353; Wed, 16 Sep 2020 16:58:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3F80782320; Wed, 16 Sep 2020 16:58:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail2.br-automation.com (mail2.br-automation.com [213.33.116.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3B9BA82314 for ; Wed, 16 Sep 2020 16:57:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=wolfgang.wallner@br-automation.com X-AuditID: c0a80110-e3fff70000001e7e-30-5f6227f4e500 Received: from brsmtp01.br-automation.co.at (Unknown_Domain [192.168.1.60]) by mail2.br-automation.com () with SMTP id 7C.B7.07806.4F7226F5; Wed, 16 Sep 2020 16:57:56 +0200 (CEST) From: "Wolfgang Wallner" To: "Bin Meng" ,"Simon Glass" Cc: u-boot@lists.denx.de,"Andy Shevchenko" ,"Wolfgang Wallner" Subject: [PATCH v2 2/2] x86: acpi: Add memset to initialize SPCR table Date: Wed, 16 Sep 2020 16:57:53 +0200 Message-Id: <20200916145753.684377-2-wolfgang.wallner@br-automation.com> In-Reply-To: <20200916145753.684377-1-wolfgang.wallner@br-automation.com> X-Mailer: git-send-email 2.28.0 References: <20200916145753.684377-1-wolfgang.wallner@br-automation.com> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on BRSMTPINTERN2/InternSMTP(Release 10.0.1FP3|August 09, 2019) at 16/09/2020 16:57:55, Serialize by Router on BRSMTPINTERN2/InternSMTP(Release 10.0.1FP3|August 09, 2019) at 16/09/2020 16:57:55, Itemize by SMTP Server on BRSMTP01/Eggelsberg/AT/B&R(Release 10.0.1FP3|August 09, 2019) at 09/16/2020 04:57:56 PM X-TNEFEvaluated: 1 X-Disclaimed: 34299 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsVyYAWjje4X9aR4gwPrNS16m6YzWUztibf4 tmUbo8XbvZ3sDiwesxsusnjsnHWX3WPeyUCPs3d2MAawRHHZpKTmZJalFunbJXBl3GjOLFjH WfFi1RLGBsYP7F2MnBwSAiYSPx69Zeti5OIQEtjKKNF2bCsjSIJNwFai8chWNhBbRMBFYvHW /UwgRcwCXYwSb/v7WUASwgJuEhOmPWAGsVkEVCV+r78GNJWDg1fAQ+LJBmeQMKeAp8Tb+0/A ypkFtCWWLXzNDLFYXuJp73IwWwio/FDHbLC9vAKCEidngtRzAdXcZpL4e+gnC0SDkMTpxWeh moUlJv/ezD6BUWAWkrmzkPQvYGRaxSiem5iZY6SXVKSbWFqSn5tYkpmfp5ecn7uJERKmAjsY d7/RPsTIxMF4iFGCg1lJhPdAY3y8EG9KYmVValF+fFFpTmrxIUZpDhYlcd55CobxQgLpiSWp 2ampBalFMFkmDk6pBkYJ57IPHqYqJ95NWxkkfVu/6f+OY3yS+xQj/2VsS9FxCZ4y5+5ZF2XX qtutMvez2CaGGD9kn/n0w+GTRxKuiWvMEHO8dsBuW0x2oMmR/ZUiOm9SeA5OT+PLrJoq0WDA pHLl+ZLExrVphZvuzP54yEt1znX989Gv18sIpuy7kqd+zXrf9T21GkuVWIozEg21mIuKEwEk yclHQQIAAA== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add a missing memset to acpi_create_spcr(). The other acpi_create_xxxx() functions perform a memset on their structures, acpi_create_spcr() does not and as a result the contents of this table are partly uninitialized (and thus random after every reset). Fixes: commit b288cd960072 ("x86: acpi: Generate SPCR table") Signed-off-by: Wolfgang Wallner Reviewed-by: Andy Shevchenko Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v2: - Removed unrelated whitespace change - Added Reviewed-by tags arch/x86/lib/acpi_table.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index 6b827bfa3f..c445aa6870 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -252,6 +252,8 @@ static void acpi_create_spcr(struct acpi_spcr *spcr) int space_id; int ret = -ENODEV; + memset((void *)spcr, 0, sizeof(struct acpi_spcr)); + /* Fill out header fields */ acpi_fill_header(header, "SPCR"); header->length = sizeof(struct acpi_spcr);