Skip to content

Commit

Permalink
mac80211: fix kmalloc vs. net_ratelimit
Browse files Browse the repository at this point in the history
The "goto end;" part definitely must not be rate limited.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Feb 28, 2008
1 parent 53b3f8e commit 03147df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/mac80211/ieee80211_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,10 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
/* prepare reordering buffer */
tid_agg_rx->reorder_buf =
kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);
if ((!tid_agg_rx->reorder_buf) && net_ratelimit()) {
printk(KERN_ERR "can not allocate reordering buffer "
"to tid %d\n", tid);
if (!tid_agg_rx->reorder_buf) {
if (net_ratelimit())
printk(KERN_ERR "can not allocate reordering buffer "
"to tid %d\n", tid);
goto end;
}
memset(tid_agg_rx->reorder_buf, 0,
Expand Down

0 comments on commit 03147df

Please sign in to comment.