Skip to content

Commit d15b845

Browse files
JoePercheslinvjw
authored andcommitted
mac80211: Remove unnecessary OOM logging messages
Removing unnecessary messages saves code and text. Site specific OOM messages are duplications of a generic MM out of memory message and aren't really useful, so just delete them. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 239289e commit d15b845

10 files changed

Lines changed: 32 additions & 93 deletions

File tree

‎net/mac80211/agg-rx.c‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,8 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d
167167
u16 capab;
168168

169169
skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
170-
171-
if (!skb) {
172-
printk(KERN_DEBUG "%s: failed to allocate buffer "
173-
"for addba resp frame\n", sdata->name);
170+
if (!skb)
174171
return;
175-
}
176172

177173
skb_reserve(skb, local->hw.extra_tx_headroom);
178174
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
@@ -279,14 +275,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
279275

280276
/* prepare A-MPDU MLME for Rx aggregation */
281277
tid_agg_rx = kmalloc(sizeof(struct tid_ampdu_rx), GFP_KERNEL);
282-
if (!tid_agg_rx) {
283-
#ifdef CONFIG_MAC80211_HT_DEBUG
284-
if (net_ratelimit())
285-
printk(KERN_ERR "allocate rx mlme to tid %d failed\n",
286-
tid);
287-
#endif
278+
if (!tid_agg_rx)
288279
goto end;
289-
}
290280

291281
spin_lock_init(&tid_agg_rx->reorder_lock);
292282

@@ -306,11 +296,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
306296
tid_agg_rx->reorder_time =
307297
kcalloc(buf_size, sizeof(unsigned long), GFP_KERNEL);
308298
if (!tid_agg_rx->reorder_buf || !tid_agg_rx->reorder_time) {
309-
#ifdef CONFIG_MAC80211_HT_DEBUG
310-
if (net_ratelimit())
311-
printk(KERN_ERR "can not allocate reordering buffer "
312-
"to tid %d\n", tid);
313-
#endif
314299
kfree(tid_agg_rx->reorder_buf);
315300
kfree(tid_agg_rx->reorder_time);
316301
kfree(tid_agg_rx);

‎net/mac80211/agg-tx.c‎

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
6868

6969
skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
7070

71-
if (!skb) {
72-
printk(KERN_ERR "%s: failed to allocate buffer "
73-
"for addba request frame\n", sdata->name);
71+
if (!skb)
7472
return;
75-
}
73+
7674
skb_reserve(skb, local->hw.extra_tx_headroom);
7775
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
7876
memset(mgmt, 0, 24);
@@ -114,11 +112,9 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1
114112
u16 bar_control = 0;
115113

116114
skb = dev_alloc_skb(sizeof(*bar) + local->hw.extra_tx_headroom);
117-
if (!skb) {
118-
printk(KERN_ERR "%s: failed to allocate buffer for "
119-
"bar frame\n", sdata->name);
115+
if (!skb)
120116
return;
121-
}
117+
122118
skb_reserve(skb, local->hw.extra_tx_headroom);
123119
bar = (struct ieee80211_bar *)skb_put(skb, sizeof(*bar));
124120
memset(bar, 0, sizeof(*bar));
@@ -413,11 +409,6 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
413409
/* prepare A-MPDU MLME for Tx aggregation */
414410
tid_tx = kzalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC);
415411
if (!tid_tx) {
416-
#ifdef CONFIG_MAC80211_HT_DEBUG
417-
if (net_ratelimit())
418-
printk(KERN_ERR "allocate tx mlme to tid %d failed\n",
419-
tid);
420-
#endif
421412
ret = -ENOMEM;
422413
goto err_unlock_sta;
423414
}
@@ -574,14 +565,9 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
574565
struct ieee80211_ra_tid *ra_tid;
575566
struct sk_buff *skb = dev_alloc_skb(0);
576567

577-
if (unlikely(!skb)) {
578-
#ifdef CONFIG_MAC80211_HT_DEBUG
579-
if (net_ratelimit())
580-
printk(KERN_WARNING "%s: Not enough memory, "
581-
"dropping start BA session", sdata->name);
582-
#endif
568+
if (unlikely(!skb))
583569
return;
584-
}
570+
585571
ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
586572
memcpy(&ra_tid->ra, ra, ETH_ALEN);
587573
ra_tid->tid = tid;
@@ -727,14 +713,9 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
727713
struct ieee80211_ra_tid *ra_tid;
728714
struct sk_buff *skb = dev_alloc_skb(0);
729715

730-
if (unlikely(!skb)) {
731-
#ifdef CONFIG_MAC80211_HT_DEBUG
732-
if (net_ratelimit())
733-
printk(KERN_WARNING "%s: Not enough memory, "
734-
"dropping stop BA session", sdata->name);
735-
#endif
716+
if (unlikely(!skb))
736717
return;
737-
}
718+
738719
ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
739720
memcpy(&ra_tid->ra, ra, ETH_ALEN);
740721
ra_tid->tid = tid;

‎net/mac80211/debugfs.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf,
297297
char *buf = kzalloc(mxln, GFP_KERNEL);
298298
int sf = 0; /* how many written so far */
299299

300+
if (!buf)
301+
return 0;
302+
300303
sf += snprintf(buf, mxln - sf, "0x%x\n", local->hw.flags);
301304
if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
302305
sf += snprintf(buf + sf, mxln - sf, "HAS_RATE_CONTROL\n");

‎net/mac80211/ht.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,8 @@ void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
186186
u16 params;
187187

188188
skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
189-
190-
if (!skb) {
191-
printk(KERN_ERR "%s: failed to allocate buffer "
192-
"for delba frame\n", sdata->name);
189+
if (!skb)
193190
return;
194-
}
195191

196192
skb_reserve(skb, local->hw.extra_tx_headroom);
197193
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);

‎net/mac80211/mesh.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,9 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr,
200200
}
201201

202202
p = kmem_cache_alloc(rm_cache, GFP_ATOMIC);
203-
if (!p) {
204-
printk(KERN_DEBUG "o11s: could not allocate RMC entry\n");
203+
if (!p)
205204
return 0;
206-
}
205+
207206
p->seqnum = seqnum;
208207
p->exp_time = jiffies + RMC_TIMEOUT;
209208
memcpy(p->sa, sa, ETH_ALEN);

‎net/mac80211/mlme.c‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,9 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
271271
struct ieee80211_mgmt *mgmt;
272272

273273
skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*mgmt));
274-
if (!skb) {
275-
printk(KERN_DEBUG "%s: failed to allocate buffer for "
276-
"deauth/disassoc frame\n", sdata->name);
274+
if (!skb)
277275
return;
278-
}
276+
279277
skb_reserve(skb, local->hw.extra_tx_headroom);
280278

281279
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
@@ -354,11 +352,9 @@ static void ieee80211_send_4addr_nullfunc(struct ieee80211_local *local,
354352
return;
355353

356354
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30);
357-
if (!skb) {
358-
printk(KERN_DEBUG "%s: failed to allocate buffer for 4addr "
359-
"nullfunc frame\n", sdata->name);
355+
if (!skb)
360356
return;
361-
}
357+
362358
skb_reserve(skb, local->hw.extra_tx_headroom);
363359

364360
nullfunc = (struct ieee80211_hdr *) skb_put(skb, 30);
@@ -2441,11 +2437,8 @@ static int ieee80211_pre_assoc(struct ieee80211_sub_if_data *sdata,
24412437
int err;
24422438

24432439
sta = sta_info_alloc(sdata, bssid, GFP_KERNEL);
2444-
if (!sta) {
2445-
printk(KERN_DEBUG "%s: failed to alloc STA entry for"
2446-
" the AP\n", sdata->name);
2440+
if (!sta)
24472441
return -ENOMEM;
2448-
}
24492442

24502443
sta->dummy = true;
24512444

‎net/mac80211/spectmgmt.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da
3232

3333
skb = dev_alloc_skb(sizeof(*msr_report) + local->hw.extra_tx_headroom +
3434
sizeof(struct ieee80211_msrment_ie));
35-
36-
if (!skb) {
37-
printk(KERN_ERR "%s: failed to allocate buffer for "
38-
"measurement report frame\n", sdata->name);
35+
if (!skb)
3936
return;
40-
}
4137

4238
skb_reserve(skb, local->hw.extra_tx_headroom);
4339
msr_report = (struct ieee80211_mgmt *)skb_put(skb, 24);

‎net/mac80211/tx.c‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,11 +2365,9 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
23652365
local = sdata->local;
23662366

23672367
skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*pspoll));
2368-
if (!skb) {
2369-
printk(KERN_DEBUG "%s: failed to allocate buffer for "
2370-
"pspoll template\n", sdata->name);
2368+
if (!skb)
23712369
return NULL;
2372-
}
2370+
23732371
skb_reserve(skb, local->hw.extra_tx_headroom);
23742372

23752373
pspoll = (struct ieee80211_pspoll *) skb_put(skb, sizeof(*pspoll));
@@ -2405,11 +2403,9 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
24052403
local = sdata->local;
24062404

24072405
skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*nullfunc));
2408-
if (!skb) {
2409-
printk(KERN_DEBUG "%s: failed to allocate buffer for nullfunc "
2410-
"template\n", sdata->name);
2406+
if (!skb)
24112407
return NULL;
2412-
}
2408+
24132409
skb_reserve(skb, local->hw.extra_tx_headroom);
24142410

24152411
nullfunc = (struct ieee80211_hdr_3addr *) skb_put(skb,
@@ -2444,11 +2440,8 @@ struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
24442440

24452441
skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*hdr) +
24462442
ie_ssid_len + ie_len);
2447-
if (!skb) {
2448-
printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
2449-
"request template\n", sdata->name);
2443+
if (!skb)
24502444
return NULL;
2451-
}
24522445

24532446
skb_reserve(skb, local->hw.extra_tx_headroom);
24542447

‎net/mac80211/util.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,9 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
707707

708708
skb = dev_alloc_skb(local->hw.extra_tx_headroom +
709709
sizeof(*mgmt) + 6 + extra_len);
710-
if (!skb) {
711-
printk(KERN_DEBUG "%s: failed to allocate buffer for auth "
712-
"frame\n", sdata->name);
710+
if (!skb)
713711
return;
714-
}
712+
715713
skb_reserve(skb, local->hw.extra_tx_headroom);
716714

717715
mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24 + 6);
@@ -864,11 +862,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
864862

865863
/* FIXME: come up with a proper value */
866864
buf = kmalloc(200 + ie_len, GFP_KERNEL);
867-
if (!buf) {
868-
printk(KERN_DEBUG "%s: failed to allocate temporary IE "
869-
"buffer\n", sdata->name);
865+
if (!buf)
870866
return NULL;
871-
}
872867

873868
/*
874869
* Do not send DS Channel parameter for directed probe requests

‎net/mac80211/work.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
229229
wk->ie_len + /* extra IEs */
230230
9, /* WMM */
231231
GFP_KERNEL);
232-
if (!skb) {
233-
printk(KERN_DEBUG "%s: failed to allocate buffer for assoc "
234-
"frame\n", sdata->name);
232+
if (!skb)
235233
return;
236-
}
234+
237235
skb_reserve(skb, local->hw.extra_tx_headroom);
238236

239237
capab = WLAN_CAPABILITY_ESS;

0 commit comments

Comments
 (0)