staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context
authorAdham Abozaeid <adham.abozaeid@microchip.com>
Tue, 16 Apr 2019 23:17:07 +0000 (23:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 10:40:51 +0000 (12:40 +0200)
txq_add_mgmt_pkt allocates memory while being called from atomic context
so needs to use GFP_ATOMIC

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wlan.c

index 2b309c8a8fb25b6359953f169a39ecd0797f2b30..0a713409ea98225f4cfd46071ac2005eea1e622e 100644 (file)
@@ -316,7 +316,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
        if (wilc->quit)
                return 0;
 
-       tqe = kmalloc(sizeof(*tqe), GFP_KERNEL);
+       tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
 
        if (!tqe)
                return 0;