* Re: [PATCH] slab: fix for_each_kmem_cache_node
[not found] ` <20140911143357.43ece13ce88eec413c3004b1@linux-foundation.org>
@ 2014-09-11 21:50 ` Mikulas Patocka
0 siblings, 0 replies; only message in thread
From: Mikulas Patocka @ 2014-09-11 21:50 UTC (permalink / raw)
To: Andrew Morton
Cc: Christoph Lameter, Pekka Enberg, Pekka Enberg, David Rientjes,
Joonsoo Kim, linux-mm, linux-kernel
On Thu, 11 Sep 2014, Andrew Morton wrote:
> On Mon, 8 Sep 2014 09:16:34 -0500 (CDT) Christoph Lameter <cl@linux.com> wrote:
>
> >
> > Acked-by: Christoph Lameter <cl@linux.com>
>
> I suspect the original patch got eaten by the linux-foundation.org DNS
> outage, and whoever started this thread didn't cc any mailing lists.
> So I have no patch and no way of finding it.
>
> Full resend with appropriate cc's please, after adding all the
> acked-bys and reviewed-bys.
This patch fixes a bug (discovered with kmemcheck) in
for_each_kmem_cache_node. The for loop reads the array "node" before
verifying that the index is within the range. This results in kmemcheck
warning.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: Christoph Lameter <cl@linux.com>
---
mm/slab.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/slab.h
===================================================================
--- linux-2.6.orig/mm/slab.h 2014-09-04 23:04:31.000000000 +0200
+++ linux-2.6/mm/slab.h 2014-09-04 23:23:37.000000000 +0200
@@ -303,8 +303,8 @@ static inline struct kmem_cache_node *ge
* a kmem_cache_node structure allocated (which is true for all online nodes)
*/
#define for_each_kmem_cache_node(__s, __node, __n) \
- for (__node = 0; __n = get_node(__s, __node), __node < nr_node_ids; __node++) \
- if (__n)
+ for (__node = 0; __node < nr_node_ids; __node++) \
+ if ((__n = get_node(__s, __node)))
#endif
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-11 21:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <alpine.LRH.2.02.1409051155001.5269@file01.intranet.prod.int.rdu2.redhat.com>
[not found] ` <540AD4B4.3010403@iki.fi>
[not found] ` <alpine.DEB.2.11.1409080916230.20388@gentwo.org>
[not found] ` <20140911143357.43ece13ce88eec413c3004b1@linux-foundation.org>
2014-09-11 21:50 ` [PATCH] slab: fix for_each_kmem_cache_node Mikulas Patocka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).