[bug report] rtw88: Add update beacon flow for AP mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Po-Hao Huang,

The patch f2217968ffda: "rtw88: Add update beacon flow for AP mode"
from Apr 7, 2022, leads to the following Smatch static checker
warning:

	drivers/net/wireless/realtek/rtw88/fw.c:1070 rtw_get_rsvd_page_skb()
	error: uninitialized symbol 'tim_offset'.

drivers/net/wireless/realtek/rtw88/fw.c
    1043 static struct sk_buff *rtw_get_rsvd_page_skb(struct ieee80211_hw *hw,
    1044                                              struct rtw_rsvd_page *rsvd_pkt)
    1045 {
    1046         struct ieee80211_vif *vif;
    1047         struct rtw_vif *rtwvif;
    1048         struct sk_buff *skb_new;
    1049         struct cfg80211_ssid *ssid;
    1050         u16 tim_offset;
    1051 
    1052         if (rsvd_pkt->type == RSVD_DUMMY) {
    1053                 skb_new = alloc_skb(1, GFP_KERNEL);
    1054                 if (!skb_new)
    1055                         return NULL;
    1056 
    1057                 skb_put(skb_new, 1);
    1058                 return skb_new;
    1059         }
    1060 
    1061         rtwvif = rsvd_pkt->rtwvif;
    1062         if (!rtwvif)
    1063                 return NULL;
    1064 
    1065         vif = rtwvif_to_vif(rtwvif);
    1066 
    1067         switch (rsvd_pkt->type) {
    1068         case RSVD_BEACON:
    1069                 skb_new = ieee80211_beacon_get_tim(hw, vif, &tim_offset, NULL);
--> 1070                 rsvd_pkt->tim_offset = tim_offset;
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tim_offset uninitialized on error path.  True but does anyone care?
Not sure.

    1071                 break;
    1072         case RSVD_PS_POLL:
    1073                 skb_new = ieee80211_pspoll_get(hw, vif);
    1074                 break;
    1075         case RSVD_PROBE_RESP:
    1076                 skb_new = ieee80211_proberesp_get(hw, vif);
    1077                 break;
    1078         case RSVD_NULL:
    1079                 skb_new = ieee80211_nullfunc_get(hw, vif, false);
    1080                 break;
    1081         case RSVD_QOS_NULL:
    1082                 skb_new = ieee80211_nullfunc_get(hw, vif, true);
    1083                 break;
    1084         case RSVD_LPS_PG_DPK:
    1085                 skb_new = rtw_lps_pg_dpk_get(hw);
    1086                 break;
    1087         case RSVD_LPS_PG_INFO:
    1088                 skb_new = rtw_lps_pg_info_get(hw);
    1089                 break;
    1090         case RSVD_PROBE_REQ:
    1091                 ssid = (struct cfg80211_ssid *)rsvd_pkt->ssid;
    1092                 if (ssid)
    1093                         skb_new = ieee80211_probereq_get(hw, vif->addr,
    1094                                                          ssid->ssid,
    1095                                                          ssid->ssid_len, 0);
    1096                 else
    1097                         skb_new = ieee80211_probereq_get(hw, vif->addr, NULL, 0, 0);
    1098                 if (skb_new)
    1099                         rsvd_pkt->probe_req_size = (u16)skb_new->len;
    1100                 break;
    1101         case RSVD_NLO_INFO:
    1102                 skb_new = rtw_nlo_info_get(hw);
    1103                 break;
    1104         case RSVD_CH_INFO:
    1105                 skb_new = rtw_cs_channel_info_get(hw);
    1106                 break;
    1107         default:
    1108                 return NULL;
    1109         }
    1110 
    1111         if (!skb_new)
    1112                 return NULL;
    1113 
    1114         return skb_new;
    1115 }

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux