OSDN Git Service

qcacld-3.0: Fix another uninitialized variable
authorJulian Liu <wlootlxt123@gmail.com>
Sat, 20 Jul 2019 09:55:59 +0000 (17:55 +0800)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 11:00:11 +0000 (19:00 +0800)
commit6c7d1510e1ece45e72fb580db15fc516def01658
treeb9bf76056d1688cffd4f8a332807154f69f0f91a
parent841de9332c5f6783ed6f1607a168df8798de411c
qcacld-3.0: Fix another uninitialized variable

Clang warns:
drivers/staging/qcacld-3.0/core/sme/src/csr/csr_util.c:1819:8: error:
      variable 'phyMode2' is used uninitialized whenever 'if' condition is
      false [-Werror,-Wsometimes-uninitialized]
                        if (eCSR_DOT11_MODE_AUTO & phyMode) {
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/qcacld-3.0/core/sme/src/csr/csr_util.c:1826:36: note:
      uninitialized use occurs here
                fMatch = csr_get_phy_mode_in_use(phyMode2, phyModeInBssDesc,
                                                 ^~~~~~~~
drivers/staging/qcacld-3.0/core/sme/src/csr/csr_util.c:1819:4: note:
      remove the 'if' if its condition is always true
                        if (eCSR_DOT11_MODE_AUTO & phyMode) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/qcacld-3.0/core/sme/src/csr/csr_util.c:1797:2: note:
      variable 'phyMode2' is declared here
        eCsrPhyMode phyModeInBssDesc = eCSR_DOT11_MODE_AUTO, phyMode2;
        ^
1 error generated.
drivers/staging/qcacld-3.0/core/sme/src/csr/csr_util.c