From: David Miller <davem@davemloft.net>
To: yjwei@cn.fujitsu.com
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linville@tuxdriver.com
Subject: Re: [PATCH] mac80211: cleanup kmalloc/memset -> kcalloc
Date: Sun, 18 Jan 2009 21:43:35 -0800 (PST) [thread overview]
Message-ID: <20090118.214335.142183946.davem@davemloft.net> (raw)
In-Reply-To: <496F04BC.3030703@cn.fujitsu.com>
From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Thu, 15 Jan 2009 17:41:16 +0800
> Transform calls kmalloc/memset to a single kcalloc.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Wireless, thus this goes to linux-wireless and John
Linville, CC:'d
> 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
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-01-19 5:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 9:41 [PATCH] mac80211: cleanup kmalloc/memset -> kcalloc Wei Yongjun
2009-01-19 5:43 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090118.214335.142183946.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=yjwei@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).