mac80211: cleanup kmalloc/memset -> kcalloc
authorWei Yongjun <yjwei@cn.fujitsu.com>
Thu, 15 Jan 2009 09:41:16 +0000 (17:41 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 21:00:47 +0000 (16:00 -0500)
Transform calls kmalloc/memset to a single kcalloc.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ht.c

index 6be48526423621bd1ce69c5fb39d0dda352293f2..7a38d2e76ca9c6fbf89515fa4a7df5a46fe26360 100644 (file)
@@ -950,7 +950,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())
@@ -960,8 +960,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,