projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1092283
)
slab: fix for_each_kmem_cache_node()
author
Mikulas Patocka
<
[email protected]
>
Thu, 9 Oct 2014 22:26:20 +0000
(15:26 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 10 Oct 2014 02:25:51 +0000
(22:25 -0400)
Fix 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 <
[email protected]
>
Reviewed-by: Pekka Enberg <
[email protected]
>
Acked-by: Christoph Lameter <
[email protected]
>
Cc: David Rientjes <
[email protected]
>
Cc: Joonsoo Kim <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/slab.h
patch
|
blob
|
history
diff --git
a/mm/slab.h
b/mm/slab.h
index 026e7c393f0be3ec2a7a66bb835bf5d69d8006d6..6599f2084e80ef4e4e4dcd62abd7078b42efe216 100644
(file)
--- a/
mm/slab.h
+++ b/
mm/slab.h
@@
-338,8
+338,8
@@
static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node)
* 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), __n
ode < nr_node_ids; __node++) \
- if (
__n
)
+ for (__node = 0; __node < nr_node_ids; __node++) \
+ if (
(__n = get_node(__s, __node))
)
#endif