]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
batman-adv: use GFP_KERNEL allocations for the wifi detection cache
authorSven Eckelmann <sven@narfation.org>
Tue, 2 Jun 2026 15:46:10 +0000 (17:46 +0200)
committerSven Eckelmann <sven@narfation.org>
Fri, 5 Jun 2026 07:12:06 +0000 (09:12 +0200)
The batadv_wifi_net_device_insert() is called with ASSERT_RTNL() held, but
not inside a spinlock or another context which prevents "might_sleep"
functions. To relax the requirements for the allocator, use GFP_KERNEL.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/hard-interface.c

index 96b8130375a3af96aea99cef301fe8fcaa6c275c..04b227ec8052511e768e9f2591058e22e504eb03 100644 (file)
@@ -983,11 +983,11 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
 
        ASSERT_RTNL();
 
-       device_state = kzalloc_obj(*device_state, GFP_ATOMIC);
+       device_state = kzalloc_obj(*device_state, GFP_KERNEL);
        if (!device_state)
                return -ENOMEM;
 
-       netdev_hold(net_dev, &device_state->dev_tracker, GFP_ATOMIC);
+       netdev_hold(net_dev, &device_state->dev_tracker, GFP_KERNEL);
        device_state->netdev = net_dev;
        WRITE_ONCE(device_state->wifi_flags, wifi_flags);