Skip to contentSkip to conversation

mac80211: cleanup kmalloc/memset -> kcalloc

PATCH In review Wei Yongjun 2 participants 2 messages Jan 15, 2009 – Jan 19, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: cleanup kmalloc/memset -> kcalloc

Transform calls kmalloc/memset to a single kcalloc.

---
 net/mac80211/ht.c               |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
net/mac80211/ht.c +1 -3
index 5f510a1..743d530 100644
@@ -949,7 +949,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 
 	/* prepare reordering buffer */
 	tid_agg_rx->reorder_buf =
-		kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC);
+		kcalloc(buf_size, sizeof(struct sk_buff *), GFP_ATOMIC);
 	if (!tid_agg_rx->reorder_buf) {
 #ifdef CONFIG_MAC80211_HT_DEBUG
 		if (net_ratelimit())
@@ -959,8 +959,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 		kfree(sta->ampdu_mlme.tid_rx[tid]);
 		goto end;
 	}
-	memset(tid_agg_rx->reorder_buf, 0,
-		buf_size * sizeof(struct sk_buff *));
 
 	if (local->ops->ampdu_action)
 		ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,
Signature · 1 line
1.6.0.3
maintainer
#1 lore raw

From: Wei Yongjun <[email protected]>
Date: Thu, 15 Jan 2009 17:41:16 +0800

Quoted 3 lines

Transform calls kmalloc/memset to a single kcalloc.

Wireless, thus this goes to linux-wireless and John Linville, CC:'d

Quoted 31 lines
net/mac80211/ht.c +1 -3
index 5f510a1..743d530 100644
@@ -949,7 +949,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 
 	/* prepare reordering buffer */
 	tid_agg_rx->reorder_buf =
-		kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC);
+		kcalloc(buf_size, sizeof(struct sk_buff *), GFP_ATOMIC);
 	if (!tid_agg_rx->reorder_buf) {
 #ifdef CONFIG_MAC80211_HT_DEBUG
 		if (net_ratelimit())
@@ -959,8 +959,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 		kfree(sta->ampdu_mlme.tid_rx[tid]);
 		goto end;
 	}
-	memset(tid_agg_rx->reorder_buf, 0,
-		buf_size * sizeof(struct sk_buff *));
 
 	if (local->ops->ampdu_action)
 		ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,
Signature · 8 lines
1.6.0.3



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html