no need to protect against put_user_ns(NULL)
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 May 2019 16:42:58 +0000 (12:42 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 25 May 2019 21:59:54 +0000 (17:59 -0400)
it's a no-op

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/x86/kernel/cpu/resctrl/rdtgroup.c
fs/sysfs/mount.c
kernel/cgroup/cgroup.c

index 333c177a2471e01161fdb1131ecb6007a3c2ce67..68bd609026e61166a8d70d1fed1338592e27f082 100644 (file)
@@ -2108,8 +2108,7 @@ static int rdt_init_fs_context(struct fs_context *fc)
        ctx->kfc.magic = RDTGROUP_SUPER_MAGIC;
        fc->fs_private = &ctx->kfc;
        fc->ops = &rdt_fs_context_ops;
-       if (fc->user_ns)
-               put_user_ns(fc->user_ns);
+       put_user_ns(fc->user_ns);
        fc->user_ns = get_user_ns(&init_user_ns);
        fc->global = true;
        return 0;
index 1b56686ab178dc6d4363ea2f76fde6cff90926da..db81cfbab9d60700f3d743ba97a589ea63637bdd 100644 (file)
@@ -72,8 +72,7 @@ static int sysfs_init_fs_context(struct fs_context *fc)
        fc->fs_private = kfc;
        fc->ops = &sysfs_fs_context_ops;
        if (netns) {
-               if (fc->user_ns)
-                       put_user_ns(fc->user_ns);
+               put_user_ns(fc->user_ns);
                fc->user_ns = get_user_ns(netns->user_ns);
        }
        fc->global = true;
index 217cec4e22c68c6053b0e8406b670affd64963dc..bbcdd3457eb0dc472511cbd1c2f2af640d41f920 100644 (file)
@@ -2184,8 +2184,7 @@ static int cgroup_init_fs_context(struct fs_context *fc)
                fc->ops = &cgroup_fs_context_ops;
        else
                fc->ops = &cgroup1_fs_context_ops;
-       if (fc->user_ns)
-               put_user_ns(fc->user_ns);
+       put_user_ns(fc->user_ns);
        fc->user_ns = get_user_ns(ctx->ns->user_ns);
        fc->global = true;
        return 0;