]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ethernet :mellanox :mlx5: Replace pci_pool_alloc by pci_pool_zalloc
authorSouptick Joarder <jrdr.linux@gmail.com>
Tue, 29 Nov 2016 21:20:18 +0000 (02:50 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 19:56:37 +0000 (14:56 -0500)
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>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c

index 0fe7a60bf66a5aa03caa521cdd0b8e034560de46..b0448b55fbc7dc454a2c07d259d5e65ad44863e8 100644 (file)
@@ -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;