From: Johannes Berg Date: Fri, 21 Oct 2011 08:22:22 +0000 (+0200) Subject: mac80211: exit cooked monitor RX early if there are none X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=152c477aa3eb8046b35aa7cde2782230064041d8;p=openwrt%2Fstaging%2Fblogic.git mac80211: exit cooked monitor RX early if there are none If there are no cooked monitor interfaces, there's no point in building the radiotap RX header for the frame and iterating the interface list. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index b867bd55de7a..c74e542a26b0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2489,6 +2489,10 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, goto out_free_skb; rx->flags |= IEEE80211_RX_CMNTR; + /* If there are no cooked monitor interfaces, just free the SKB */ + if (!local->cooked_mntrs) + goto out_free_skb; + if (skb_headroom(skb) < sizeof(*rthdr) && pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) goto out_free_skb;