From patchwork Mon Oct 12 13:26:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 270195 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 0CF5AC43457 for ; Mon, 12 Oct 2020 14:09:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D01F020838 for ; Mon, 12 Oct 2020 14:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602511739; bh=iRvc1h8Jd7frY6IyZasTKD964KP/bVwB2tsTNK254ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=K6lPBFnMARCMpzL1fbnZhuG45Wlryk8HonRtF8fKZEj35NVD5/csU7igpeOBY4GbN pUUk4fUhGydLpkZwJOJzxoeIA0SXdLamEiZUPhqGsfWJughjNlJdjsskOA032sxlGc AKsutKUGKVILbqX0yNPgmJSi2NgPYatv03vEEgTg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgJLOI7 (ORCPT ); Mon, 12 Oct 2020 10:08:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:35472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389153AbgJLNdV (ORCPT ); Mon, 12 Oct 2020 09:33:21 -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 3BFB420878; Mon, 12 Oct 2020 13:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509600; bh=iRvc1h8Jd7frY6IyZasTKD964KP/bVwB2tsTNK254ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=baD1rDVAdJWD4Yw31o3xiQKGevyL40+0DxV9U65xv7OeFo/t4gClVvJzfqT4s+JDD 2tk/mxBde3SGQd5NBZsv9th/quQ1TKjmd9FYDcMwiZppfmTRlvVkK7qWzwTDebwCba 74n+bcolZtY/+vmNaBajZUY3pMvEEsbmot3xjcu8= 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.4 23/39] platform/x86: thinkpad_acpi: initialize tp_nvram_state variable Date: Mon, 12 Oct 2020 15:26:53 +0200 Message-Id: <20201012132629.240360556@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132628.130632267@linuxfoundation.org> References: <20201012132628.130632267@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 @@ -2474,7 +2474,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;