diff options
author | Eric Dumazet <edumazet@google.com> | 2018-12-13 14:03:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-17 22:18:02 +0300 |
commit | 4beaacc6fea5a5ec43c55c22a6c83c03a5ecc775 (patch) | |
tree | d7339bc54f9ee67b71054afd92f8055bed111c20 /drivers/net/ethernet/mellanox/mlx4/en_cq.c | |
parent | c03b0358ab60504151b35587c88205c7b7fe22be (diff) | |
download | linux-4beaacc6fea5a5ec43c55c22a6c83c03a5ecc775.tar.xz |
net/mlx4_en: remove fallback after kzalloc_node()
kzalloc_node(..., GFP_KERNEL, node) will attempt to allocate
memory as close as possible to the node.
There is no need to fallback to kzalloc() if this has failed.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_cq.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_cq.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c index 062a88fcc5d6..74d466796b7c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c @@ -54,11 +54,8 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, cq = kzalloc_node(sizeof(*cq), GFP_KERNEL, node); if (!cq) { - cq = kzalloc(sizeof(*cq), GFP_KERNEL); - if (!cq) { - en_err(priv, "Failed to allocate CQ structure\n"); - return -ENOMEM; - } + en_err(priv, "Failed to allocate CQ structure\n"); + return -ENOMEM; } cq->size = entries; |