aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/user_namespace.h2
-rw-r--r--mm/slab.c4
-rw-r--r--mm/slub.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index bb320573bb9..1101b0ce878 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -49,7 +49,7 @@ static inline struct user_namespace *copy_user_ns(int flags,
if (flags & CLONE_NEWUSER)
return ERR_PTR(-EINVAL);
- return NULL;
+ return old_ns;
}
static inline void put_user_ns(struct user_namespace *ns)
diff --git a/mm/slab.c b/mm/slab.c
index 88bc6336ce3..c3feeaab387 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3690,8 +3690,8 @@ static __always_inline void *__do_kmalloc(size_t size, gfp_t flags,
* functions.
*/
cachep = __find_general_cachep(size, flags);
- if (unlikely(cachep == NULL))
- return NULL;
+ if (unlikely(ZERO_OR_NULL_PTR(cachep)))
+ return cachep;
return __cache_alloc(cachep, flags, caller);
}
diff --git a/mm/slub.c b/mm/slub.c
index 52a4f44be39..322f3a5d72c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2394,7 +2394,7 @@ size_t ksize(const void *object)
struct page *page;
struct kmem_cache *s;
- if (object == ZERO_SIZE_PTR)
+ if (ZERO_OR_NULL_PTR(object))
return 0;
page = get_object_page(object);