[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dda4079bc35fa6e0846a94e9c2b91b0c3a224c52.camel@perches.com>
Date: Tue, 29 Dec 2020 08:17:58 -0800
From: Joe Perches <joe@...ches.com>
To: Zheng Yongjun <zhengyongjun3@...wei.com>, davem@...emloft.net,
kuba@...nel.org, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: saeedm@...dia.com, leon@...nel.org
Subject: Re: [PATCH net-next] net/mlx5: Use kzalloc for allocating only one
thing
On Tue, 2020-12-29 at 21:53 +0800, Zheng Yongjun wrote:
> Use kzalloc rather than kcalloc(1,...)
[]
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
[]
> @@ -1782,7 +1782,7 @@ static int dr_action_create_modify_action(struct mlx5dr_domain *dmn,
> if (!chunk)
> return -ENOMEM;
>
>
> - hw_actions = kcalloc(1, max_hw_actions * DR_MODIFY_ACTION_SIZE, GFP_KERNEL);
> + hw_actions = kzalloc(max_hw_actions * DR_MODIFY_ACTION_SIZE, GFP_KERNEL);
Perhaps instead:
hw_actions = kcalloc(max_hw_actions, DR_MODIFY_ACTION_SIZE, GFP_KERNEL);
Powered by blists - more mailing lists