Commit 50ba3c18 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

RDMA/mlx5: Use proper allocation API to get zeroed memory

There is no need in custom memory zeroing, because it can be done
by using kzalloc from the beginning.
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 0bddcff6
...@@ -4726,7 +4726,7 @@ static int __get_port_caps(struct mlx5_ib_dev *dev, u8 port) ...@@ -4726,7 +4726,7 @@ static int __get_port_caps(struct mlx5_ib_dev *dev, u8 port)
int err = -ENOMEM; int err = -ENOMEM;
struct ib_udata uhw = {.inlen = 0, .outlen = 0}; struct ib_udata uhw = {.inlen = 0, .outlen = 0};
pprops = kmalloc(sizeof(*pprops), GFP_KERNEL); pprops = kzalloc(sizeof(*pprops), GFP_KERNEL);
if (!pprops) if (!pprops)
goto out; goto out;
...@@ -4740,7 +4740,6 @@ static int __get_port_caps(struct mlx5_ib_dev *dev, u8 port) ...@@ -4740,7 +4740,6 @@ static int __get_port_caps(struct mlx5_ib_dev *dev, u8 port)
goto out; goto out;
} }
memset(pprops, 0, sizeof(*pprops));
err = mlx5_ib_query_port(&dev->ib_dev, port, pprops); err = mlx5_ib_query_port(&dev->ib_dev, port, pprops);
if (err) { if (err) {
mlx5_ib_warn(dev, "query_port %d failed %d\n", mlx5_ib_warn(dev, "query_port %d failed %d\n",
......
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