[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ3xEMg8HU9OvPmSziez=dx-y98knpbU1Qs4N1JeJiVNjyL_Sw@mail.gmail.com>
Date: Sun, 18 Sep 2016 23:24:49 +0300
From: Or Gerlitz <gerlitz.or@...il.com>
To: Leon Romanovsky <leonro@...lanox.com>,
Amir Vadai <amirva@...lanox.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>,
Tariq Toukan <tariqt@...lanox.com>,
Hadar Har-Zion <hadarh@...lanox.com>,
Roi Dayan <roid@...lanox.com>,
Or Gerlitz <ogerlitz@...lanox.com>
Subject: Re: [PATCH net 1/3] net/mlx5: Fix flow counter bulk command out
mailbox allocation
On Sun, Sep 18, 2016 at 9:02 PM, Leon Romanovsky <leon@...nel.org> wrote:
> On Sun, Sep 18, 2016 at 06:20:27PM +0300, Or Gerlitz wrote:
>> From: Roi Dayan <roid@...lanox.com>
>> @@ -425,11 +425,11 @@ struct mlx5_cmd_fc_bulk *
>> mlx5_cmd_fc_bulk_alloc(struct mlx5_core_dev *dev, u16 id, int num)
>> {
>> struct mlx5_cmd_fc_bulk *b;
>> - int outlen = sizeof(*b) +
>> + int outlen =
>> MLX5_ST_SZ_BYTES(query_flow_counter_out) +
>> MLX5_ST_SZ_BYTES(traffic_counter) * num;
>>
>> - b = kzalloc(outlen, GFP_KERNEL);
>> + b = kzalloc(sizeof(*b) + outlen, GFP_KERNEL);
>> if (!b)
>> return NULL;
> ^^^^^^^^^ very controversial decision.
> The code flow mlx5_fc_stats_query->mlx5_cmd_fc_bulk_alloc->kzalloc
> failure is the same for success scenario too.
Sure, we will look on your comment and if needed come up with a
cleanup patch for net-next (4.9)
> It is not related to the proposed patch.
Correct, the proposed patch fixes a memory corruption that we want to
sort out for net (4.8)
Or.
Powered by blists - more mailing lists