]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: sgi: use GFP_ATOMIC under spin lock
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 16 Feb 2019 01:48:09 +0000 (01:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Feb 2019 23:51:46 +0000 (15:51 -0800)
The function meth_init_tx_ring() is called from meth_tx_timeout(),
in which spin_lock is held, so we should use GFP_ATOMIC instead.

Fixes: 8d4c28fbc284 ("meth: pass struct device to DMA API functions")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sgi/meth.c

index f425ab528224bc9c0db80b65d1ca2a48bb015025..f1271402ca2114ffce95af53ad3e977612328177 100644 (file)
@@ -214,7 +214,7 @@ static int meth_init_tx_ring(struct meth_private *priv)
 {
        /* Init TX ring */
        priv->tx_ring = dma_alloc_coherent(&priv->pdev->dev,
-                       TX_RING_BUFFER_SIZE, &priv->tx_ring_dma, GFP_KERNEL);
+                       TX_RING_BUFFER_SIZE, &priv->tx_ring_dma, GFP_ATOMIC);
        if (!priv->tx_ring)
                return -ENOMEM;