netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: cleanup kmalloc/memset -> kcalloc
@ 2009-01-15  9:41 Wei Yongjun
  2009-01-19  5:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2009-01-15  9:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Transform calls kmalloc/memset to a single kcalloc.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/mac80211/ht.c               |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 5f510a1..743d530 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -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,
-- 
1.6.0.3




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-19  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15  9:41 [PATCH] mac80211: cleanup kmalloc/memset -> kcalloc Wei Yongjun
2009-01-19  5:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).