Skip to content

Commit

Permalink
wlcore: fix size of two memset's in wl1271_cmd_build_arp_rsp()
Browse files Browse the repository at this point in the history
We currently do this:

int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif)
...
      struct wl12xx_arp_rsp_template *tmpl;
      struct ieee80211_hdr_3addr *hdr;
...
      tmpl = (struct wl12xx_arp_rsp_template *)skb_put(skb, sizeof(*tmpl));
      memset(tmpl, 0, sizeof(tmpl));
...
      hdr = (struct ieee80211_hdr_3addr *)skb_push(skb, sizeof(*hdr));
      memset(hdr, 0, sizeof(hdr));
...

I believe we want to set the entire structures to 0 with those
memset() calls, not just zero the initial part of them (size of the
pointer bytes).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information
Jesper Juhl authored and John W. Linville committed May 15, 2012
1 parent bd28a58 commit 161f17b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/ti/wlcore/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif)
skb_reserve(skb, sizeof(*hdr) + WL1271_EXTRA_SPACE_MAX);

tmpl = (struct wl12xx_arp_rsp_template *)skb_put(skb, sizeof(*tmpl));
memset(tmpl, 0, sizeof(tmpl));
memset(tmpl, 0, sizeof(*tmpl));

/* llc layer */
memcpy(tmpl->llc_hdr, rfc1042_header, sizeof(rfc1042_header));
Expand Down Expand Up @@ -1085,7 +1085,7 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif)

/* mac80211 header */
hdr = (struct ieee80211_hdr_3addr *)skb_push(skb, sizeof(*hdr));
memset(hdr, 0, sizeof(hdr));
memset(hdr, 0, sizeof(*hdr));
fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_TODS;
if (wlvif->sta.qos)
fc |= IEEE80211_STYPE_QOS_DATA;
Expand Down

0 comments on commit 161f17b

Please sign in to comment.