lkml.org 
[lkml]   [2019]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] [net-next] net/mlx5e: xsk: dynamically allocate mlx5e_channel_param
Date
On 2019-07-08 18:16, Maxim Mikityanskiy wrote:
> On 2019-07-08 15:55, Arnd Bergmann wrote:
>> - mlx5e_build_xsk_cparam(priv, params, xsk, &cparam);
>> + cparam = kzalloc(sizeof(*cparam), GFP_KERNEL);
>
> Similar code in mlx5e_open_channels (en_main.c) uses kvzalloc. Although
> the struct is currently smaller than a page anyway, and there should be
> no difference in behavior now, I suggest using the same alloc function
> to keep code uniform.
>
>> /* Create a dedicated SQ for posting NOPs whenever we need an IRQ to be
>> * triggered and NAPI to be called on the correct CPU.
>> */
>> - err = mlx5e_open_icosq(c, params, &cparam.icosq, &c->xskicosq);
>> + err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->xskicosq);
>> if (unlikely(err))
>> goto err_close_icocq;
>>
>
> Here is kfree missing. It's a memory leak in the good path.

Arnd, I'm going to take over your patch and respin it, addressing my own
comments, because it's been quite a while, and we want to have this fix.

Thanks for spotting it.
\
 
 \ /
  Last update: 2019-07-23 13:22    [W:0.049 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site