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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150610064108.GB566@swordfish>
Date:	Wed, 10 Jun 2015 15:41:08 +0900
From:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:	Julia Lawall <julia.lawall@...6.fr>
Cc:	Joe Perches <joe@...ches.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Minchan Kim <minchan@...nel.org>,
	Christoph Lameter <cl@...ux.com>,
	Pekka Enberg <penberg@...nel.org>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Michal Hocko <mhocko@...e.cz>,
	David Rientjes <rientjes@...gle.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, sergey.senozhatsky.work@...il.com
Subject: Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools'
 destroy() functions

On (06/10/15 07:46), Julia Lawall wrote:
> > > Well I like it, even though it's going to cause a zillion little cleanup
> > > patches.
> 
> Actually only at most 87.  There are some functions that look quite a bit 
> nicer with the change, like:
> 
>  void jffs2_destroy_slab_caches(void)
>  {
> -       if(full_dnode_slab)
> -               kmem_cache_destroy(full_dnode_slab);
> -       if(raw_dirent_slab)
> -               kmem_cache_destroy(raw_dirent_slab);
> -       if(raw_inode_slab)
> -               kmem_cache_destroy(raw_inode_slab);
> -       if(tmp_dnode_info_slab)
> -               kmem_cache_destroy(tmp_dnode_info_slab);
> -       if(raw_node_ref_slab)
> -               kmem_cache_destroy(raw_node_ref_slab);
> -       if(node_frag_slab)
> -               kmem_cache_destroy(node_frag_slab);
> -       if(inode_cache_slab)
> -               kmem_cache_destroy(inode_cache_slab);
> +       kmem_cache_destroy(full_dnode_slab);
> +       kmem_cache_destroy(raw_dirent_slab);
> +       kmem_cache_destroy(raw_inode_slab);
> +       kmem_cache_destroy(tmp_dnode_info_slab);
> +       kmem_cache_destroy(raw_node_ref_slab);
> +       kmem_cache_destroy(node_frag_slab);
> +       kmem_cache_destroy(inode_cache_slab);
>  #ifdef CONFIG_JFFS2_FS_XATTR
> -       if (xattr_datum_cache)
> -               kmem_cache_destroy(xattr_datum_cache);
> -       if (xattr_ref_cache)
> -               kmem_cache_destroy(xattr_ref_cache);
> +       kmem_cache_destroy(xattr_datum_cache);
> +       kmem_cache_destroy(xattr_ref_cache);
>  #endif
>  }
> 

and some goto labels can go away either. like

[..]

err_percpu_counter_init:
	kmem_cache_destroy(sctp_chunk_cachep);
err_chunk_cachep:
	kmem_cache_destroy(sctp_bucket_cachep);

[..]

and others.

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ