Commit 77d1337b authored by Souptick Joarder's avatar Souptick Joarder Committed by David S. Miller

ethernet :mellanox :mlx4: Replace pci_pool_alloc by pci_pool_zalloc

In mlx4_alloc_cmd_mailbox(), pci_pool_alloc() followed by memset will be
replaced by pci_pool_zalloc()
Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d109e61b
...@@ -2679,15 +2679,13 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev) ...@@ -2679,15 +2679,13 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev)
if (!mailbox) if (!mailbox)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
mailbox->buf = pci_pool_alloc(mlx4_priv(dev)->cmd.pool, GFP_KERNEL, mailbox->buf = pci_pool_zalloc(mlx4_priv(dev)->cmd.pool, GFP_KERNEL,
&mailbox->dma); &mailbox->dma);
if (!mailbox->buf) { if (!mailbox->buf) {
kfree(mailbox); kfree(mailbox);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE);
return mailbox; return mailbox;
} }
EXPORT_SYMBOL_GPL(mlx4_alloc_cmd_mailbox); EXPORT_SYMBOL_GPL(mlx4_alloc_cmd_mailbox);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment