[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200917214628.GC29136@mtg-dev.jf.intel.com>
Date: Thu, 17 Sep 2020 14:46:28 -0700
From: mark gross <mgross@...ux.intel.com>
To: trix@...hat.com
Cc: ibm-acpi@....eng.br, dvhart@...radead.org, andy@...radead.org,
natechancellor@...il.com, ndesaulniers@...gle.com,
len.brown@...el.com, ibm-acpi-devel@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: initialize tp_nvram_state
variable
Acked-by: mark gross <mgross@...ux.intel.com>
--mark
On Sun, Sep 13, 2020 at 12:02:03PM -0700, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
>
> 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 <trix@...hat.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 47925c319d7b..24da8b6872f2 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -2573,7 +2573,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
> */
> 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;
> --
> 2.18.1
>
Powered by blists - more mailing lists