Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: Use GFP_KERNEL instead of GFP_ATOMIC when possible

Previous memory allocations in this function already use GFP_KERNEL, so
use __dev_alloc_skb() and an explicit GFP_KERNEL instead of an implicit
GFP_ATOMIC.

This gives more opportunities of successful allocation.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/194a0e2ff00c3fae88cc9fba47431747360c8242.1645345378.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Christophe JAILLET and committed by
Johannes Berg
60df54f8 3856f1b3

+1 -1
+1 -1
net/mac80211/mesh.c
··· 853 853 854 854 bcn = kzalloc(sizeof(*bcn) + head_len + tail_len, GFP_KERNEL); 855 855 /* need an skb for IE builders to operate on */ 856 - skb = dev_alloc_skb(max(head_len, tail_len)); 856 + skb = __dev_alloc_skb(max(head_len, tail_len), GFP_KERNEL); 857 857 858 858 if (!bcn || !skb) 859 859 goto out_free;