cfg80211: clarify BSS probe response vs. beacon data
[firefly-linux-kernel-4.4.55.git] / net / wireless / scan.c
index 0798c62e60858cb81d1df3d4829414665808268b..ad1a1a2808d3c68c7da1c6977d247df3c1ca9dbd 100644 (file)
@@ -918,11 +918,12 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
         * override the IEs pointer should we have received an earlier
         * indication of Probe Response data.
         */
-       ies = kmalloc(sizeof(*ies) + ielen, gfp);
+       ies = kzalloc(sizeof(*ies) + ielen, gfp);
        if (!ies)
                return NULL;
        ies->len = ielen;
        ies->tsf = tsf;
+       ies->from_beacon = false;
        memcpy(ies->data, ie, ielen);
 
        rcu_assign_pointer(tmp.pub.beacon_ies, ies);
@@ -982,11 +983,12 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
        if (!channel)
                return NULL;
 
-       ies = kmalloc(sizeof(*ies) + ielen, gfp);
+       ies = kzalloc(sizeof(*ies) + ielen, gfp);
        if (!ies)
                return NULL;
        ies->len = ielen;
        ies->tsf = le64_to_cpu(mgmt->u.probe_resp.timestamp);
+       ies->from_beacon = ieee80211_is_beacon(mgmt->frame_control);
        memcpy(ies->data, mgmt->u.probe_resp.variable, ielen);
 
        if (ieee80211_is_probe_resp(mgmt->frame_control))