linux-stable/drivers/misc/cardreader
Nathan Chancellor bd476c1306 misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw()
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: b1c5f30851 ("misc: rtsx: add rts5261 efuse function")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Tom Rix <trix@redhat.com>
Suggested-by: Ricky WU <ricky_wu@realtek.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20220523150521.2947108-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-10 15:29:17 +02:00
..
alcor_pci.c misc: alcor_pci: set NULL intfdata and clear pci master 2022-05-19 18:57:17 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile misc: rtsx: Add support new chip rts5228 mmc: rtsx: Add support MMC_CAP2_NO_MMC 2020-07-10 14:58:47 +02:00
rtl8411.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5209.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5227.c misc: rtsx: rts522a rts5228 rts5261 support Runtime PM 2022-02-25 12:11:16 +01:00
rts5228.c misc: rtsx: clean up one inconsistent indenting 2022-03-18 13:52:30 +01:00
rts5228.h misc: rtsx: Add support new chip rts5228 mmc: rtsx: Add support MMC_CAP2_NO_MMC 2020-07-10 14:58:47 +02:00
rts5229.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5249.c misc: rtsx: Quiesce rts5249 on system suspend 2022-01-26 18:53:28 +01:00
rts5260.c misc: rtsx: separate aspm mode into MODE_REG and MODE_CFG 2021-06-09 19:10:22 +02:00
rts5260.h
rts5261.c misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw() 2022-06-10 15:29:17 +02:00
rts5261.h misc: rtsx: Check mmc support for RTS5261 2020-11-16 11:59:30 +01:00
rtsx_pcr.c misc: rtsx: conditionally build rtsx_pm_power_saving() 2022-02-25 12:10:45 +01:00
rtsx_pcr.h misc: rtsx: rts522a rts5228 rts5261 support Runtime PM 2022-02-25 12:11:16 +01:00
rtsx_usb.c misc: rtsx: set NULL intfdata when probe fails 2022-05-09 15:40:15 +02:00