lkml.org 
[lkml]   [2019]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] [net-next] net/mlx5e: xsk: dynamically allocate mlx5e_channel_param
On Tue, Jul 23, 2019 at 1:21 PM Maxim Mikityanskiy <maximmi@mellanox.com> wrote:
> 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.

Thanks for taking care of it now. I was planning to do a respin, but
the reply got lost in the depth of my inbox so I forgot about it.

Arnd

\
 
 \ /
  Last update: 2019-07-23 13:30    [W:0.038 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site