Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fec668d3 authored by Souptick Joarder's avatar Souptick Joarder Committed by David S. Miller
Browse files

ethernet :mellanox :mlx5: Replace pci_pool_alloc by pci_pool_zalloc



In alloc_cmd_box(), pci_pool_alloc() followed by memset will be
replaced by pci_pool_zalloc()

Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 77d1337b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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->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;