[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a1pRmTeufSUOrRZx_B=VafmG33P1_vzn-YTpcSKDjfvVA@mail.gmail.com>
Date: Tue, 24 May 2022 14:30:36 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
clang-built-linux <llvm@...ts.linux.dev>,
patches@...ts.linux.dev, Dan Carpenter <dan.carpenter@...cle.com>,
kernel test robot <lkp@...el.com>, Tom Rix <trix@...hat.com>,
Ricky WU <ricky_wu@...ltek.com>
Subject: Re: [PATCH] misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw()
On Mon, May 23, 2022 at 5:05 PM Nathan Chancellor <nathan@...nel.org> wrote:
>
> Clang warns:
>
> drivers/misc/cardreader/rts5261.c:406:13: error: variable 'setting_reg2' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> } else if (efuse_valid == 0) {
> ^~~~~~~~~~~~~~~~
> drivers/misc/cardreader/rts5261.c:412:30: note: uninitialized use occurs here
> pci_read_config_dword(pdev, setting_reg2, &lval2);
> ^~~~~~~~~~~~
>
> efuse_valid == 1 is not a valid value so just return early from the
> function to avoid using setting_reg2 uninitialized.
>
> Fixes: b1c5f3085149 ("misc: rtsx: add rts5261 efuse function")
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Tom Rix <trix@...hat.com>
> Suggested-by: Ricky WU <ricky_wu@...ltek.com>
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
Looks good to me,
Acked-by: Arnd Bergmann <arnd@...db.de>
Powered by blists - more mailing lists