CC: [email protected]
CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: "Bryan O'Donoghue" <[email protected]>
CC: Kalle Valo <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   763a906a02e961eedabab7dbedd16904a3bd0184
commit: d6f2746691cb10e484f15ab9e44e2cc2ccf9bd86 [556/6237] wcn36xx: Track the 
band and channel we are tuned to
:::::: branch date: 13 hours ago
:::::: commit date: 4 weeks ago
config: x86_64-randconfig-c007 
(https://download.01.org/0day-ci/archive/20220217/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
0e628a783b935c70c80815db6c061ec84f884af5)
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d6f2746691cb10e484f15ab9e44e2cc2ccf9bd86
        git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout d6f2746691cb10e484f15ab9e44e2cc2ccf9bd86
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
               ^~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:303:2: note: Taking false branch
           if (!tbl.data)
           ^
   net/ipv4/sysctl_net_ipv4.c:307:6: note: Assuming 'n_keys' is not equal to 0
           if (!n_keys) {
               ^~~~~~~
   net/ipv4/sysctl_net_ipv4.c:307:2: note: Taking false branch
           if (!n_keys) {
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is true
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is true
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is false
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is false. Execution 
continues on line 315
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:315:14: note: Assuming 'i' is < 'n_keys'
           for (i = 0; i < n_keys; i++) {
                       ^~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:315:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys; i++) {
           ^
   net/ipv4/sysctl_net_ipv4.c:316:10: note: 6th function call argument is an 
uninitialized value
                   off += snprintf(tbl.data + off, tbl.maxlen - off,
                          ^
   net/ipv4/sysctl_net_ipv4.c:316:10: warning: 7th function call argument is an 
uninitialized value [clang-analyzer-core.CallAndMessage]
                   off += snprintf(tbl.data + off, tbl.maxlen - off,
                          ^
   net/ipv4/sysctl_net_ipv4.c:302:13: note: Calling 'kmalloc'
           tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:578:2: note: Taking false branch
           if (__builtin_constant_p(size)) {
           ^
   include/linux/slab.h:595:2: note: Returning pointer, which participates in a 
condition later
           return __kmalloc(size, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:302:13: note: Returning from 'kmalloc'
           tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:303:6: note: Assuming field 'data' is non-null
           if (!tbl.data)
               ^~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:303:2: note: Taking false branch
           if (!tbl.data)
           ^
   net/ipv4/sysctl_net_ipv4.c:307:6: note: Assuming 'n_keys' is not equal to 0
           if (!n_keys) {
               ^~~~~~~
   net/ipv4/sysctl_net_ipv4.c:307:2: note: Taking false branch
           if (!n_keys) {
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is true
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is true
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is true
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:312:14: note: Assuming the condition is false
           for (i = 0; i < n_keys * 4; i++)
                       ^~~~~~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:312:2: note: Loop condition is false. Execution 
continues on line 315
           for (i = 0; i < n_keys * 4; i++)
           ^
   net/ipv4/sysctl_net_ipv4.c:315:14: note: Assuming 'i' is < 'n_keys'
           for (i = 0; i < n_keys; i++) {
                       ^~~~~~~~~~
   net/ipv4/sysctl_net_ipv4.c:315:2: note: Loop condition is true.  Entering 
loop body
           for (i = 0; i < n_keys; i++) {
           ^
   net/ipv4/sysctl_net_ipv4.c:316:10: note: 7th function call argument is an 
uninitialized value
                   off += snprintf(tbl.data + off, tbl.maxlen - off,
                          ^
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   15 warnings generated.
>> drivers/net/wireless/ath/wcn36xx/main.c:409:7: warning: Branch condition 
>> evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
                   if (channel)
                       ^
   drivers/net/wireless/ath/wcn36xx/main.c:434:2: note: Assuming the condition 
is false
           wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed);
           ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:69:6: note: expanded from macro 
'wcn36xx_dbg'
           if (wcn36xx_dbg_mask & mask)                                    \
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:434:2: note: Taking false branch
           wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed);
           ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:69:2: note: expanded from macro 
'wcn36xx_dbg'
           if (wcn36xx_dbg_mask & mask)                                    \
           ^
   drivers/net/wireless/ath/wcn36xx/main.c:434:2: note: Loop condition is 
false.  Exiting loop
           wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed);
           ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:68:40: note: expanded from macro 
'wcn36xx_dbg'
   #define wcn36xx_dbg(mask, fmt, arg...) do {                     \
                                          ^
   drivers/net/wireless/ath/wcn36xx/main.c:438:6: note: Assuming the condition 
is true
           if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:438:2: note: Taking true branch
           if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
           ^
   drivers/net/wireless/ath/wcn36xx/main.c:440:3: note: Assuming the condition 
is false
                   wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel 
switch=%d\n",
                   ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:69:6: note: expanded from macro 
'wcn36xx_dbg'
           if (wcn36xx_dbg_mask & mask)                                    \
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:440:3: note: Taking false branch
                   wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel 
switch=%d\n",
                   ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:69:2: note: expanded from macro 
'wcn36xx_dbg'
           if (wcn36xx_dbg_mask & mask)                                    \
           ^
   drivers/net/wireless/ath/wcn36xx/main.c:440:3: note: Loop condition is 
false.  Exiting loop
                   wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel 
switch=%d\n",
                   ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:68:40: note: expanded from macro 
'wcn36xx_dbg'
   #define wcn36xx_dbg(mask, fmt, arg...) do {                     \
                                          ^
   drivers/net/wireless/ath/wcn36xx/main.c:443:7: note: Assuming 'ch' is not 
equal to field 'sw_scan_opchannel'
                   if (wcn->sw_scan_opchannel == ch && wcn->sw_scan_channel) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:443:36: note: Left side of '&&' is 
false
                   if (wcn->sw_scan_opchannel == ch && wcn->sw_scan_channel) {
                                                    ^
   drivers/net/wireless/ath/wcn36xx/main.c:454:14: note: Assuming field 
'sw_scan' is false
                   } else if (wcn->sw_scan) {
                              ^~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:454:10: note: Taking false branch
                   } else if (wcn->sw_scan) {
                          ^
   drivers/net/wireless/ath/wcn36xx/main.c:474:4: note: Calling 
'wcn36xx_change_opchannel'
                           wcn36xx_change_opchannel(wcn, ch);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:396:2: note: 'channel' declared 
without an initial value
           struct ieee80211_channel *channel;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:399:2: note: Loop condition is true. 
 Entering loop body
           for (i = 0; i < ARRAY_SIZE(wcn->hw->wiphy->bands); i++) {
           ^
   drivers/net/wireless/ath/wcn36xx/main.c:401:7: note: Assuming 'band' is 
non-null
                   if (!band)
                       ^~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:401:3: note: Taking false branch
                   if (!band)
                   ^
   drivers/net/wireless/ath/wcn36xx/main.c:403:15: note: Assuming 'j' is >= 
field 'n_channels'
                   for (j = 0; j < band->n_channels; j++) {
                               ^~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:403:3: note: Loop condition is 
false. Execution continues on line 409
                   for (j = 0; j < band->n_channels; j++) {
                   ^
   drivers/net/wireless/ath/wcn36xx/main.c:409:7: note: Branch condition 
evaluates to a garbage value
                   if (channel)
                       ^~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:413:6: warning: Branch condition 
evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
           if (!channel) {
               ^
   drivers/net/wireless/ath/wcn36xx/main.c:434:2: note: Assuming the condition 
is false
           wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed);
           ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:69:6: note: expanded from macro 
'wcn36xx_dbg'
           if (wcn36xx_dbg_mask & mask)                                    \
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/main.c:434:2: note: Taking false branch
           wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed);
           ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:69:2: note: expanded from macro 
'wcn36xx_dbg'
           if (wcn36xx_dbg_mask & mask)                                    \
           ^
   drivers/net/wireless/ath/wcn36xx/main.c:434:2: note: Loop condition is 
false.  Exiting loop
           wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed);
           ^
   drivers/net/wireless/ath/wcn36xx/wcn36xx.h:68:40: note: expanded from macro 
'wcn36xx_dbg'
   #define wcn36xx_dbg(mask, fmt, arg...) do {                     \

vim +409 drivers/net/wireless/ath/wcn36xx/main.c

5973a2947430a29 Loic Poulain     2020-08-24  390  
5973a2947430a29 Loic Poulain     2020-08-24  391  static void 
wcn36xx_change_opchannel(struct wcn36xx *wcn, int ch)
5973a2947430a29 Loic Poulain     2020-08-24  392  {
5973a2947430a29 Loic Poulain     2020-08-24  393        struct ieee80211_vif 
*vif = NULL;
5973a2947430a29 Loic Poulain     2020-08-24  394        struct wcn36xx_vif *tmp;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  395        struct 
ieee80211_supported_band *band;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  396        struct 
ieee80211_channel *channel;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  397        int i, j;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  398  
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  399        for (i = 0; i < 
ARRAY_SIZE(wcn->hw->wiphy->bands); i++) {
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  400                band = 
wcn->hw->wiphy->bands[i];
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  401                if (!band)
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  402                        break;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  403                for (j = 0; j < 
band->n_channels; j++) {
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  404                        if 
(HW_VALUE_CHANNEL(band->channels[j].hw_value) == ch) {
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  405                                
channel = &band->channels[j];
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  406                                
break;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  407                        }
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  408                }
d6f2746691cb10e Bryan O'Donoghue 2022-01-15 @409                if (channel)
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  410                        break;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  411        }
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  412  
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  413        if (!channel) {
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  414                
wcn36xx_err("Cannot tune to channel %d\n", ch);
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  415                return;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  416        }
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  417  
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  418        wcn->band = band;
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  419        wcn->channel = channel;
5973a2947430a29 Loic Poulain     2020-08-24  420  
5973a2947430a29 Loic Poulain     2020-08-24  421        
list_for_each_entry(tmp, &wcn->vif_list, list) {
5973a2947430a29 Loic Poulain     2020-08-24  422                vif = 
wcn36xx_priv_to_vif(tmp);
5973a2947430a29 Loic Poulain     2020-08-24  423                
wcn36xx_smd_switch_channel(wcn, vif, ch);
5973a2947430a29 Loic Poulain     2020-08-24  424        }
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  425  
d6f2746691cb10e Bryan O'Donoghue 2022-01-15  426        return;
5973a2947430a29 Loic Poulain     2020-08-24  427  }
5973a2947430a29 Loic Poulain     2020-08-24  428  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to