Skip to content

Commit

Permalink
ethernet :mellanox :mlx5: Replace pci_pool_alloc by pci_pool_zalloc
Browse files Browse the repository at this point in the history
In alloc_cmd_box(), pci_pool_alloc() followed by memset will be
replaced by pci_pool_zalloc()

Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Souptick Joarder authored and David S. Miller committed Nov 30, 2016
1 parent 77d1337 commit fec668d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,14 +1066,13 @@ static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev,
if (!mailbox)
return ERR_PTR(-ENOMEM);

mailbox->buf = pci_pool_alloc(dev->cmd.pool, flags,
&mailbox->dma);
mailbox->buf = pci_pool_zalloc(dev->cmd.pool, flags,
&mailbox->dma);
if (!mailbox->buf) {
mlx5_core_dbg(dev, "failed allocation\n");
kfree(mailbox);
return ERR_PTR(-ENOMEM);
}
memset(mailbox->buf, 0, sizeof(struct mlx5_cmd_prot_block));
mailbox->next = NULL;

return mailbox;
Expand Down

0 comments on commit fec668d

Please sign in to comment.