kernel: pid_namespace: use NULL instead of using plain integer as pointer
authorHaowen Bai <baihaowen@meizu.com>
Fri, 29 Apr 2022 21:38:00 +0000 (14:38 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 21:38:00 +0000 (14:38 -0700)
This fixes the following sparse warnings:
kernel/pid_namespace.c:55:77: warning: Using plain integer as NULL pointer

Link: https://lkml.kernel.org/r/1647944288-2806-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/pid_namespace.c

index a46a3723bc66271836a0ffdd42706190c23095f2..f4f8cb0435b4557c9473d4864be13e98eac3d861 100644 (file)
@@ -52,7 +52,7 @@ static struct kmem_cache *create_pid_cachep(unsigned int level)
        /* Name collision forces to do allocation under mutex. */
        if (!*pkc)
                *pkc = kmem_cache_create(name, len, 0,
-                                        SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, 0);
+                                        SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, NULL);
        mutex_unlock(&pid_caches_mutex);
        /* current can fail, but someone else can succeed. */
        return READ_ONCE(*pkc);