mm: slab - __cache_alloc NULL prefetch fix

From: Cyrill Gorcunov
Date: Thu Nov 20 2008 - 11:44:20 EST


Do not prefetch NULL

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
---

Please check

mm/slab.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.git/mm/slab.c
===================================================================
--- linux-2.6.git.orig/mm/slab.c
+++ linux-2.6.git/mm/slab.c
@@ -3395,10 +3395,11 @@ __cache_alloc(struct kmem_cache *cachep,
objp = __do_cache_alloc(cachep, flags);
local_irq_restore(save_flags);
objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller);
- prefetchw(objp);

- if (likely(objp))
+ if (likely(objp)) {
+ prefetchw(objp);
kmemcheck_slab_alloc(cachep, flags, objp, obj_size(cachep));
+ }

if (unlikely((flags & __GFP_ZERO) && objp))
memset(objp, 0, obj_size(cachep));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/