From patchwork Mon Oct 12 13:26:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 270222 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=ham 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 DFC72C433DF for ; Mon, 12 Oct 2020 14:03:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A58D12074D for ; Mon, 12 Oct 2020 14:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602511393; bh=2BdFwFQtTbQE3+U5mDfKpEwafb59mUIhSlTGuBmQSJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lD4kQHjqTr8KAyiryv8YAVEbaR3K/jkyUkM8xePbQSGYYImR9Zxe3Y2D3Gp4n35kt 90CuXiozwPiSY4iDKqexHyAEJxOYUzftIPGmrqI9l2sjUGZYJkeQL1XkXT2U11YShD 7dgTIQeWKUWdiT4hJmm20huEsULvSUhMIw0FXqFM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389463AbgJLODM (ORCPT ); Mon, 12 Oct 2020 10:03:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731009AbgJLNhP (ORCPT ); Mon, 12 Oct 2020 09:37:15 -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 C59D3221FC; Mon, 12 Oct 2020 13:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509809; bh=2BdFwFQtTbQE3+U5mDfKpEwafb59mUIhSlTGuBmQSJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FfgHvhJQJFz5+ZRrr6CS2BhJ38FO+/wOYzbgURl+C2PNg5n431RkeRr9tlMCSMGVh RYZMGy4MtGKHmYYUxkANHu7JnsGVdQWrzL6qCy8nxLkCbJf82FAPAN+dYXkUnhvykA NhZ+8NsVMy1k5cN+ubm6sSTy3XsjHIFO5oOcR1Cs= 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 4.14 38/70] platform/x86: thinkpad_acpi: initialize tp_nvram_state variable Date: Mon, 12 Oct 2020 15:26:54 +0200 Message-Id: <20201012132632.012673485@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132630.201442517@linuxfoundation.org> References: <20201012132630.201442517@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -2477,7 +2477,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;