Skip to content

Commit

Permalink
net: moxa: use GFP_KERNEL
Browse files Browse the repository at this point in the history
Platform_driver probe functions aren't called with locks
held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.

Problem found with Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20220210204223.104181-1-Julia.Lawall@inria.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Julia Lawall authored and Jakub Kicinski committed Feb 11, 2022
1 parent 5f7dc7d commit c9ac080
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/moxa/moxart_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,14 @@ static int moxart_mac_probe(struct platform_device *pdev)
}

priv->tx_buf_base = kmalloc_array(priv->tx_buf_size, TX_DESC_NUM,
GFP_ATOMIC);
GFP_KERNEL);
if (!priv->tx_buf_base) {
ret = -ENOMEM;
goto init_fail;
}

priv->rx_buf_base = kmalloc_array(priv->rx_buf_size, RX_DESC_NUM,
GFP_ATOMIC);
GFP_KERNEL);
if (!priv->rx_buf_base) {
ret = -ENOMEM;
goto init_fail;
Expand Down

0 comments on commit c9ac080

Please sign in to comment.