From: mark gross <mgross@linux.intel.com>
To: trix@redhat.com
Cc: ibm-acpi@hmh.eng.br, dvhart@infradead.org, andy@infradead.org,
natechancellor@gmail.com, ndesaulniers@google.com,
len.brown@intel.com, ibm-acpi-devel@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: initialize tp_nvram_state variable
Date: Thu, 17 Sep 2020 14:46:28 -0700 [thread overview]
Message-ID: <20200917214628.GC29136@mtg-dev.jf.intel.com> (raw)
In-Reply-To: <20200913190203.22238-1-trix@redhat.com>
Acked-by: mark gross <mgross@linux.intel.com>
--mark
On Sun, Sep 13, 2020 at 12:02:03PM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.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@redhat.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
>
prev parent reply other threads:[~2020-09-17 21:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-13 19:02 [PATCH] platform/x86: thinkpad_acpi: initialize tp_nvram_state variable trix
2020-09-14 8:39 ` Hans de Goede
2020-09-17 21:46 ` mark gross [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200917214628.GC29136@mtg-dev.jf.intel.com \
--to=mgross@linux.intel.com \
--cc=andy@infradead.org \
--cc=clang-built-linux@googlegroups.com \
--cc=dvhart@infradead.org \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ibm-acpi@hmh.eng.br \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.