Hi Larry, [auto build test WARNING on staging/staging-testing] [also build test WARNING on v4.13-rc5 next-20170817] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Larry-Finger/staging-r8822be-Add-existing-rtlwifi-and-rtl_pci-parts-for-new-driver/20170820-023830 config: i386-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): drivers/staging/rtlwifi/base.c: In function 'rtl_check_beacon_key': >> drivers/staging/rtlwifi/base.c:2546:34: warning: 'ht_cap_ie' may be used uninitialized in this function [-Wmaybe-uninitialized] bcn_key.ht_cap_info = ht_cap_ie->cap_info; ~~~~~~~~~^~~~~~~~~~ vim +/ht_cap_ie +2546 drivers/staging/rtlwifi/base.c 128be9f8 Ping-Ke Shih 2017-08-17 2465 128be9f8 Ping-Ke Shih 2017-08-17 2466 bool rtl_check_beacon_key(struct ieee80211_hw *hw, void *data, unsigned int len) 128be9f8 Ping-Ke Shih 2017-08-17 2467 { 128be9f8 Ping-Ke Shih 2017-08-17 2468 struct rtl_priv *rtlpriv = rtl_priv(hw); 128be9f8 Ping-Ke Shih 2017-08-17 2469 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 128be9f8 Ping-Ke Shih 2017-08-17 2470 struct rtl_phy *rtlphy = &rtlpriv->phy; 128be9f8 Ping-Ke Shih 2017-08-17 2471 struct ieee80211_hdr *hdr = data; 128be9f8 Ping-Ke Shih 2017-08-17 2472 struct ieee80211_ht_cap *ht_cap_ie; 128be9f8 Ping-Ke Shih 2017-08-17 2473 struct ieee80211_ht_operation *ht_oper_ie = NULL; 128be9f8 Ping-Ke Shih 2017-08-17 2474 struct rtl_beacon_keys bcn_key; 128be9f8 Ping-Ke Shih 2017-08-17 2475 struct rtl_beacon_keys *cur_bcn_key; 128be9f8 Ping-Ke Shih 2017-08-17 2476 u8 *ht_cap; 128be9f8 Ping-Ke Shih 2017-08-17 2477 u8 ht_cap_len; 128be9f8 Ping-Ke Shih 2017-08-17 2478 u8 *ht_oper; 128be9f8 Ping-Ke Shih 2017-08-17 2479 u8 ht_oper_len; 128be9f8 Ping-Ke Shih 2017-08-17 2480 u8 *ds_param; 128be9f8 Ping-Ke Shih 2017-08-17 2481 u8 ds_param_len; 128be9f8 Ping-Ke Shih 2017-08-17 2482 128be9f8 Ping-Ke Shih 2017-08-17 2483 if (mac->opmode != NL80211_IFTYPE_STATION) 128be9f8 Ping-Ke Shih 2017-08-17 2484 return false; 128be9f8 Ping-Ke Shih 2017-08-17 2485 128be9f8 Ping-Ke Shih 2017-08-17 2486 /* check if this really is a beacon*/ 128be9f8 Ping-Ke Shih 2017-08-17 2487 if (!ieee80211_is_beacon(hdr->frame_control)) 128be9f8 Ping-Ke Shih 2017-08-17 2488 return false; 128be9f8 Ping-Ke Shih 2017-08-17 2489 128be9f8 Ping-Ke Shih 2017-08-17 2490 /* min. beacon length + FCS_LEN */ 128be9f8 Ping-Ke Shih 2017-08-17 2491 if (len <= 40 + FCS_LEN) 128be9f8 Ping-Ke Shih 2017-08-17 2492 return false; 128be9f8 Ping-Ke Shih 2017-08-17 2493 128be9f8 Ping-Ke Shih 2017-08-17 2494 cur_bcn_key = &mac->cur_beacon_keys; 128be9f8 Ping-Ke Shih 2017-08-17 2495 128be9f8 Ping-Ke Shih 2017-08-17 2496 if (rtlpriv->mac80211.link_state == MAC80211_NOLINK) { 128be9f8 Ping-Ke Shih 2017-08-17 2497 if (cur_bcn_key->valid) { 128be9f8 Ping-Ke Shih 2017-08-17 2498 cur_bcn_key->valid = false; 128be9f8 Ping-Ke Shih 2017-08-17 2499 RT_TRACE(rtlpriv, COMP_BEACON, DBG_LOUD, 128be9f8 Ping-Ke Shih 2017-08-17 2500 "Reset cur_beacon_keys.valid to false!\n"); 128be9f8 Ping-Ke Shih 2017-08-17 2501 } 128be9f8 Ping-Ke Shih 2017-08-17 2502 return false; 128be9f8 Ping-Ke Shih 2017-08-17 2503 } 128be9f8 Ping-Ke Shih 2017-08-17 2504 128be9f8 Ping-Ke Shih 2017-08-17 2505 /* and only beacons from the associated BSSID, please */ 128be9f8 Ping-Ke Shih 2017-08-17 2506 if (!ether_addr_equal(hdr->addr3, rtlpriv->mac80211.bssid)) 128be9f8 Ping-Ke Shih 2017-08-17 2507 return false; 128be9f8 Ping-Ke Shih 2017-08-17 2508 128be9f8 Ping-Ke Shih 2017-08-17 2509 /***** Parsing DS Param IE ******/ 128be9f8 Ping-Ke Shih 2017-08-17 2510 ds_param = rtl_find_ie(data, len - FCS_LEN, WLAN_EID_DS_PARAMS); 128be9f8 Ping-Ke Shih 2017-08-17 2511 128be9f8 Ping-Ke Shih 2017-08-17 2512 if (ds_param && !(ds_param[1] < sizeof(*ds_param))) 128be9f8 Ping-Ke Shih 2017-08-17 2513 ds_param_len = ds_param[1]; 128be9f8 Ping-Ke Shih 2017-08-17 2514 else 128be9f8 Ping-Ke Shih 2017-08-17 2515 ds_param = NULL; 128be9f8 Ping-Ke Shih 2017-08-17 2516 128be9f8 Ping-Ke Shih 2017-08-17 2517 /***** Parsing HT Cap. IE ******/ 128be9f8 Ping-Ke Shih 2017-08-17 2518 ht_cap = rtl_find_ie(data, len - FCS_LEN, WLAN_EID_HT_CAPABILITY); 128be9f8 Ping-Ke Shih 2017-08-17 2519 128be9f8 Ping-Ke Shih 2017-08-17 2520 if (ht_cap && !(ht_cap[1] < sizeof(*ht_cap))) { 128be9f8 Ping-Ke Shih 2017-08-17 2521 ht_cap_len = ht_cap[1]; 128be9f8 Ping-Ke Shih 2017-08-17 2522 ht_cap_ie = (struct ieee80211_ht_cap *)&ht_cap[2]; 128be9f8 Ping-Ke Shih 2017-08-17 2523 } else { 128be9f8 Ping-Ke Shih 2017-08-17 2524 ht_cap = NULL; 128be9f8 Ping-Ke Shih 2017-08-17 2525 } 128be9f8 Ping-Ke Shih 2017-08-17 2526 128be9f8 Ping-Ke Shih 2017-08-17 2527 /***** Parsing HT Info. IE ******/ 128be9f8 Ping-Ke Shih 2017-08-17 2528 ht_oper = rtl_find_ie(data, len - FCS_LEN, WLAN_EID_HT_OPERATION); 128be9f8 Ping-Ke Shih 2017-08-17 2529 128be9f8 Ping-Ke Shih 2017-08-17 2530 if (ht_oper && !(ht_oper[1] < sizeof(*ht_oper))) { 128be9f8 Ping-Ke Shih 2017-08-17 2531 ht_oper_len = ht_oper[1]; 128be9f8 Ping-Ke Shih 2017-08-17 2532 ht_oper_ie = (struct ieee80211_ht_operation *)&ht_oper[2]; 128be9f8 Ping-Ke Shih 2017-08-17 2533 } else { 128be9f8 Ping-Ke Shih 2017-08-17 2534 ht_oper = NULL; 128be9f8 Ping-Ke Shih 2017-08-17 2535 } 128be9f8 Ping-Ke Shih 2017-08-17 2536 128be9f8 Ping-Ke Shih 2017-08-17 2537 /* update bcn_key */ 128be9f8 Ping-Ke Shih 2017-08-17 2538 memset(&bcn_key, 0, sizeof(bcn_key)); 128be9f8 Ping-Ke Shih 2017-08-17 2539 128be9f8 Ping-Ke Shih 2017-08-17 2540 if (ds_param) 128be9f8 Ping-Ke Shih 2017-08-17 2541 bcn_key.bcn_channel = ds_param[2]; 128be9f8 Ping-Ke Shih 2017-08-17 2542 else if (ht_oper && ht_oper_ie) 128be9f8 Ping-Ke Shih 2017-08-17 2543 bcn_key.bcn_channel = ht_oper_ie->primary_chan; 128be9f8 Ping-Ke Shih 2017-08-17 2544 128be9f8 Ping-Ke Shih 2017-08-17 2545 if (ht_cap) 128be9f8 Ping-Ke Shih 2017-08-17 @2546 bcn_key.ht_cap_info = ht_cap_ie->cap_info; 128be9f8 Ping-Ke Shih 2017-08-17 2547 128be9f8 Ping-Ke Shih 2017-08-17 2548 if (ht_oper && ht_oper_ie) 128be9f8 Ping-Ke Shih 2017-08-17 2549 bcn_key.ht_info_infos_0_sco = ht_oper_ie->ht_param & 0x03; 128be9f8 Ping-Ke Shih 2017-08-17 2550 128be9f8 Ping-Ke Shih 2017-08-17 2551 bcn_key.valid = true; 128be9f8 Ping-Ke Shih 2017-08-17 2552 128be9f8 Ping-Ke Shih 2017-08-17 2553 /* update cur_beacon_keys or compare beacon key */ 128be9f8 Ping-Ke Shih 2017-08-17 2554 if ((rtlpriv->mac80211.link_state != MAC80211_LINKED) && 128be9f8 Ping-Ke Shih 2017-08-17 2555 (rtlpriv->mac80211.link_state != MAC80211_LINKED_SCANNING)) 128be9f8 Ping-Ke Shih 2017-08-17 2556 return true; 128be9f8 Ping-Ke Shih 2017-08-17 2557 128be9f8 Ping-Ke Shih 2017-08-17 2558 if (!cur_bcn_key->valid) { 128be9f8 Ping-Ke Shih 2017-08-17 2559 /* update cur_beacon_keys */ 128be9f8 Ping-Ke Shih 2017-08-17 2560 memset(cur_bcn_key, 0, sizeof(bcn_key)); 128be9f8 Ping-Ke Shih 2017-08-17 2561 memcpy(cur_bcn_key, &bcn_key, sizeof(bcn_key)); 128be9f8 Ping-Ke Shih 2017-08-17 2562 cur_bcn_key->valid = true; 128be9f8 Ping-Ke Shih 2017-08-17 2563 128be9f8 Ping-Ke Shih 2017-08-17 2564 RT_TRACE(rtlpriv, COMP_BEACON, DBG_LOUD, 128be9f8 Ping-Ke Shih 2017-08-17 2565 "Beacon key update!ch=%d, ht_cap_info=0x%x, sco=0x%x\n", 128be9f8 Ping-Ke Shih 2017-08-17 2566 cur_bcn_key->bcn_channel, 128be9f8 Ping-Ke Shih 2017-08-17 2567 cur_bcn_key->ht_cap_info, 128be9f8 Ping-Ke Shih 2017-08-17 2568 cur_bcn_key->ht_info_infos_0_sco); 128be9f8 Ping-Ke Shih 2017-08-17 2569 return true; 128be9f8 Ping-Ke Shih 2017-08-17 2570 } 128be9f8 Ping-Ke Shih 2017-08-17 2571 128be9f8 Ping-Ke Shih 2017-08-17 2572 /* compare beacon key */ 128be9f8 Ping-Ke Shih 2017-08-17 2573 if (!memcmp(cur_bcn_key, &bcn_key, sizeof(bcn_key))) { 128be9f8 Ping-Ke Shih 2017-08-17 2574 /* same beacon key */ 128be9f8 Ping-Ke Shih 2017-08-17 2575 mac->new_beacon_cnt = 0; 128be9f8 Ping-Ke Shih 2017-08-17 2576 goto chk_exit; 128be9f8 Ping-Ke Shih 2017-08-17 2577 } 128be9f8 Ping-Ke Shih 2017-08-17 2578 128be9f8 Ping-Ke Shih 2017-08-17 2579 if ((cur_bcn_key->bcn_channel == bcn_key.bcn_channel) && 128be9f8 Ping-Ke Shih 2017-08-17 2580 (cur_bcn_key->ht_cap_info == bcn_key.ht_cap_info)) { 128be9f8 Ping-Ke Shih 2017-08-17 2581 /* Beacon HT info IE, secondary channel offset check */ 128be9f8 Ping-Ke Shih 2017-08-17 2582 /* 40M -> 20M */ 128be9f8 Ping-Ke Shih 2017-08-17 2583 if (cur_bcn_key->ht_info_infos_0_sco > 128be9f8 Ping-Ke Shih 2017-08-17 2584 bcn_key.ht_info_infos_0_sco) { 128be9f8 Ping-Ke Shih 2017-08-17 2585 /* Not a new beacon */ 128be9f8 Ping-Ke Shih 2017-08-17 2586 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2587 "Beacon BW change! sco:0x%x -> 0x%x\n", 128be9f8 Ping-Ke Shih 2017-08-17 2588 cur_bcn_key->ht_info_infos_0_sco, 128be9f8 Ping-Ke Shih 2017-08-17 2589 bcn_key.ht_info_infos_0_sco); 128be9f8 Ping-Ke Shih 2017-08-17 2590 128be9f8 Ping-Ke Shih 2017-08-17 2591 cur_bcn_key->ht_info_infos_0_sco = 128be9f8 Ping-Ke Shih 2017-08-17 2592 bcn_key.ht_info_infos_0_sco; 128be9f8 Ping-Ke Shih 2017-08-17 2593 } else { 128be9f8 Ping-Ke Shih 2017-08-17 2594 /* 20M -> 40M */ 128be9f8 Ping-Ke Shih 2017-08-17 2595 if (rtlphy->max_ht_chan_bw >= HT_CHANNEL_WIDTH_20_40) { 128be9f8 Ping-Ke Shih 2017-08-17 2596 /* Not a new beacon */ 128be9f8 Ping-Ke Shih 2017-08-17 2597 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2598 "Beacon BW change! sco:0x%x -> 0x%x\n", 128be9f8 Ping-Ke Shih 2017-08-17 2599 cur_bcn_key->ht_info_infos_0_sco, 128be9f8 Ping-Ke Shih 2017-08-17 2600 bcn_key.ht_info_infos_0_sco); 128be9f8 Ping-Ke Shih 2017-08-17 2601 128be9f8 Ping-Ke Shih 2017-08-17 2602 cur_bcn_key->ht_info_infos_0_sco = 128be9f8 Ping-Ke Shih 2017-08-17 2603 bcn_key.ht_info_infos_0_sco; 128be9f8 Ping-Ke Shih 2017-08-17 2604 } else { 128be9f8 Ping-Ke Shih 2017-08-17 2605 mac->new_beacon_cnt++; 128be9f8 Ping-Ke Shih 2017-08-17 2606 } 128be9f8 Ping-Ke Shih 2017-08-17 2607 } 128be9f8 Ping-Ke Shih 2017-08-17 2608 } else { 128be9f8 Ping-Ke Shih 2017-08-17 2609 mac->new_beacon_cnt++; 128be9f8 Ping-Ke Shih 2017-08-17 2610 } 128be9f8 Ping-Ke Shih 2017-08-17 2611 128be9f8 Ping-Ke Shih 2017-08-17 2612 if (mac->new_beacon_cnt == 1) { 128be9f8 Ping-Ke Shih 2017-08-17 2613 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2614 "Get new beacon.\n"); 128be9f8 Ping-Ke Shih 2017-08-17 2615 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2616 "Cur : ch=%d, ht_cap=0x%x, sco=0x%x\n", 128be9f8 Ping-Ke Shih 2017-08-17 2617 cur_bcn_key->bcn_channel, 128be9f8 Ping-Ke Shih 2017-08-17 2618 cur_bcn_key->ht_cap_info, 128be9f8 Ping-Ke Shih 2017-08-17 2619 cur_bcn_key->ht_info_infos_0_sco); 128be9f8 Ping-Ke Shih 2017-08-17 2620 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2621 "New RX : ch=%d, ht_cap=0x%x, sco=0x%x\n", 128be9f8 Ping-Ke Shih 2017-08-17 2622 bcn_key.bcn_channel, 128be9f8 Ping-Ke Shih 2017-08-17 2623 bcn_key.ht_cap_info, 128be9f8 Ping-Ke Shih 2017-08-17 2624 bcn_key.ht_info_infos_0_sco); 128be9f8 Ping-Ke Shih 2017-08-17 2625 128be9f8 Ping-Ke Shih 2017-08-17 2626 } else if (mac->new_beacon_cnt > 1) { 128be9f8 Ping-Ke Shih 2017-08-17 2627 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2628 "new beacon cnt: %d\n", 128be9f8 Ping-Ke Shih 2017-08-17 2629 mac->new_beacon_cnt); 128be9f8 Ping-Ke Shih 2017-08-17 2630 } 128be9f8 Ping-Ke Shih 2017-08-17 2631 128be9f8 Ping-Ke Shih 2017-08-17 2632 if (mac->new_beacon_cnt > 3) { 128be9f8 Ping-Ke Shih 2017-08-17 2633 ieee80211_connection_loss(rtlpriv->mac80211.vif); 128be9f8 Ping-Ke Shih 2017-08-17 2634 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 128be9f8 Ping-Ke Shih 2017-08-17 2635 "new beacon cnt >3, disconnect !\n"); 128be9f8 Ping-Ke Shih 2017-08-17 2636 } 128be9f8 Ping-Ke Shih 2017-08-17 2637 128be9f8 Ping-Ke Shih 2017-08-17 2638 chk_exit: 128be9f8 Ping-Ke Shih 2017-08-17 2639 128be9f8 Ping-Ke Shih 2017-08-17 2640 return true; 128be9f8 Ping-Ke Shih 2017-08-17 2641 } 128be9f8 Ping-Ke Shih 2017-08-17 2642 :::::: The code at line 2546 was first introduced by commit :::::: 128be9f870de0930fb2643e40a20c96d8d3d7fa3 staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver :::::: TO: Ping-Ke Shih <pkshih@xxxxxxxxxxx> :::::: CC: 0day robot <fengguang.wu@xxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip
_______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel