lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1421349895.11734.86.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Thu, 15 Jan 2015 11:24:55 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Martin Lau <kafai@...com>
Cc:	netdev@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH RFC v2 net-next 2/2] ip_tunnel: Remove struct gro_cells

On Thu, 2015-01-15 at 10:39 -0800, Martin Lau wrote:

> > 
> > -static inline void gro_cells_destroy(struct gro_cells *gcells)
> > +static inline void gro_cell_free_percpu(struct gro_cell __percpu *gcells)
> >  {
> >         int i;
> >  
> > -       if (!gcells->cells)
> > +       if (IS_ERR_OR_NULL(gcells))
> >                 return;
> > 
> > For example, I have no idea why this part is needed.
> For this change:
> -       err = gro_cells_init(&tunnel->gro_cells, dev);
> -       if (err) {
> +       tunnel->gro_cells = gro_cell_alloc_percpu(dev);
> +       if (IS_ERR(tunnel->gro_cells)) {

That is bad. See David Miller recent mail about this kind of construct.

Current code is better : Do not store an error code in structure, but
rather use a local variable.

Thanks


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ