Skip to contentSkip to conversation

wlcore: fix memset sizes in wl1271_cmd_build_arp_rsp()

PATCH In review Luciano Coelho 1 participant 2 messages May 3, 2012 TI wilink wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wlcore: fix memset sizes in wl1271_cmd_build_arp_rsp()

We were using the size of the pointer and not of the allocate structure itself in this function. Use the size of the structure instead.

---
 drivers/net/wireless/ti/wlcore/cmd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ti/wlcore/cmd.c +2 -2
index 5c4716c..9f1c431 100644
@@ -1034,7 +1034,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));
@@ -1083,7 +1083,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;
Signature · 1 line
1.7.10