diff mbox series

[v2] mac80211: fix GFP_KERNEL under tasklet context

Message ID 1541753896-16339-1-git-send-email-yhchuang@realtek.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series [v2] mac80211: fix GFP_KERNEL under tasklet context | expand

Commit Message

Tony Chuang Nov. 9, 2018, 8:58 a.m. UTC
From: Yan-Hsuan Chuang <yhchuang@realtek.com>

cfg80211_sta_opmode_change_notify needs a gfp_t flag to hint the nl80211
stack when allocating new skb, but it is called under tasklet context
here with GFP_KERNEL and kernel will yield a warning about it.

Fixes: ff84e7bfe176 ("mac80211: Add support to notify ht/vht opmode modification.")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 net/mac80211/rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 64742f2..03d3964f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3028,7 +3028,7 @@  ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
 			cfg80211_sta_opmode_change_notify(sdata->dev,
 							  rx->sta->addr,
 							  &sta_opmode,
-							  GFP_KERNEL);
+							  GFP_ATOMIC);
 			goto handled;
 		}
 		case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: {
@@ -3065,7 +3065,7 @@  ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
 			cfg80211_sta_opmode_change_notify(sdata->dev,
 							  rx->sta->addr,
 							  &sta_opmode,
-							  GFP_KERNEL);
+							  GFP_ATOMIC);
 			goto handled;
 		}
 		default: