V4L/DVB (7330): V4L1 - fix v4l_compat_translate_ioctl possible NULL deref
[sfrench/cifs-2.6.git] / mm / slab.c
index 473e6c2eaefbcafbba74b7e37a658422027e968e..bb4070e1079fb7e863386f84f5fd138163a9a6ba 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -333,7 +333,7 @@ static __always_inline int index_of(const size_t size)
                return i; \
        else \
                i++;
-#include "linux/kmalloc_sizes.h"
+#include <linux/kmalloc_sizes.h>
 #undef CACHE
                __bad_size();
        } else
@@ -2964,11 +2964,10 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
        struct array_cache *ac;
        int node;
 
-       node = numa_node_id();
-
+retry:
        check_irq_off();
+       node = numa_node_id();
        ac = cpu_cache_get(cachep);
-retry:
        batchcount = ac->batchcount;
        if (!ac->touched && batchcount > BATCHREFILL_LIMIT) {
                /*
@@ -3280,7 +3279,7 @@ retry:
                if (local_flags & __GFP_WAIT)
                        local_irq_enable();
                kmem_flagcheck(cache, flags);
-               obj = kmem_getpages(cache, flags, -1);
+               obj = kmem_getpages(cache, local_flags, -1);
                if (local_flags & __GFP_WAIT)
                        local_irq_disable();
                if (obj) {
@@ -3625,12 +3624,11 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 EXPORT_SYMBOL(kmem_cache_alloc);
 
 /**
- * kmem_ptr_validate - check if an untrusted pointer might
- *     be a slab entry.
+ * kmem_ptr_validate - check if an untrusted pointer might be a slab entry.
  * @cachep: the cache we're checking against
  * @ptr: pointer to validate
  *
- * This verifies that the untrusted pointer looks sane:
+ * This verifies that the untrusted pointer looks sane;
  * it is _not_ a guarantee that the pointer is actually
  * part of the slab cache in question, but it at least
  * validates that the pointer can be dereferenced and