diff options
author | Tom Rix <trix@redhat.com> | 2020-09-13 12:02:03 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-14 10:31:22 +0200 |
commit | d32b4239790f49011775f950c61162b18b2ca335 (patch) | |
tree | 61c5e9ce3ed605fca6690251fa29520a23eb2d21 | |
parent | c42dd41efbc6f5560a8c99f7647f04bf3a711674 (diff) | |
download | linux-stable-d32b4239790f49011775f950c61162b18b2ca335.tar.gz linux-stable-d32b4239790f49011775f950c61162b18b2ca335.tar.bz2 linux-stable-d32b4239790f49011775f950c61162b18b2ca335.zip |
platform/x86: thinkpad_acpi: initialize tp_nvram_state variable
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 <trix@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: mark gross <mgross@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 8f85bb4fe784..820c8f3bf87d 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -2597,7 +2597,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; |