Skip to content

Commit 5f38b06

Browse files
Tom Rixandy-shev
authored andcommitted
platform/x86: thinkpad_acpi: initialize tp_nvram_state variable
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: 01e88f2 ("ACPI: thinkpad-acpi: add CMOS NVRAM polling for hot keys (v9)") Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: mark gross <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent d823346 commit 5f38b06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
25692569
*/
25702570
static int hotkey_kthread(void *data)
25712571
{
2572-
struct tp_nvram_state s[2];
2572+
struct tp_nvram_state s[2] = { 0 };
25732573
u32 poll_mask, event_mask;
25742574
unsigned int si, so;
25752575
unsigned long t;

0 commit comments

Comments
 (0)