From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56CDBC433DF for ; Mon, 12 Oct 2020 13:48:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0603204EA for ; Mon, 12 Oct 2020 13:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510501; bh=EH5pEnr2qulRv4CBxKErSs0l2BYRHHD0iX8PM8VptwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mGBI4KPELGHI3G1Kptj9yrUzVzBL9WYWS9o4eE66PJvBhVTbFbCRKMgFzi5e4ZDtQ 7QfIsBSQRsHpUf2Zj8PwaG22dBpco6l9kPXT0RInqooviG9zTZTJyw+JxHuciswds4 3dcXfirg8nTA+6whuTNDkcXQuEKpbhCUqhDwF1T4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731923AbgJLNsT (ORCPT ); Mon, 12 Oct 2020 09:48:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:49174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389758AbgJLNpy (ORCPT ); Mon, 12 Oct 2020 09:45:54 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B666222EB; Mon, 12 Oct 2020 13:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510315; bh=EH5pEnr2qulRv4CBxKErSs0l2BYRHHD0iX8PM8VptwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/GGkBrxa3zsnNJMVGe0qLIuV3kqmnw96Z0t/olQKa1a6r6BtWk+4xWeFQtZz4Y7v yFCSzzqRhpOKRiqp4ebZXRka6PDgAOm0/hvevGp0CCc3kKwLeFprCR3+e8Gm9rEQbI /8//WJdjSkAxkFAfnXxL7DncCtnnRih8ZZg5/LPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Hans de Goede , mark gross , Andy Shevchenko Subject: [PATCH 5.8 019/124] platform/x86: thinkpad_acpi: initialize tp_nvram_state variable Date: Mon, 12 Oct 2020 15:30:23 +0200 Message-Id: <20201012133147.777031667@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix commit 5f38b06db8af3ed6c2fc1b427504ca56fae2eacc upstream. clang static analysis flags this represenative problem thinkpad_acpi.c:2523:7: warning: Branch condition evaluates to a garbage value if (!oldn->mute || ^~~~~~~~~~~ In hotkey_kthread() mute is conditionally set by hotkey_read_nvram() but unconditionally checked by hotkey_compare_and_issue_event(). So the tp_nvram_state variable s[2] needs to be initialized. Fixes: 01e88f25985d ("ACPI: thinkpad-acpi: add CMOS NVRAM polling for hot keys (v9)") Signed-off-by: Tom Rix Reviewed-by: Hans de Goede Acked-by: mark gross Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -2569,7 +2569,7 @@ static void hotkey_compare_and_issue_eve */ static int hotkey_kthread(void *data) { - struct tp_nvram_state s[2]; + struct tp_nvram_state s[2] = { 0 }; u32 poll_mask, event_mask; unsigned int si, so; unsigned long t;