selinux: remove an unneeded variable in sel_make_class_dir_entries()
authorye xingchen <ye.xingchen@zte.com.cn>
Tue, 30 Aug 2022 08:41:24 +0000 (08:41 +0000)
committerPaul Moore <paul@paul-moore.com>
Tue, 30 Aug 2022 20:26:01 +0000 (16:26 -0400)
Return the value sel_make_perm_files() directly instead of storing it
in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
[PM: subject line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/selinuxfs.c

index 8fcdd494af273f402a073d948cb6d6879c98cc12..66610eb3d317a9473c3e40d0c2949eef7ee5e222 100644 (file)
@@ -1917,7 +1917,6 @@ static int sel_make_class_dir_entries(struct selinux_policy *newpolicy,
        struct selinux_fs_info *fsi = sb->s_fs_info;
        struct dentry *dentry = NULL;
        struct inode *inode = NULL;
-       int rc;
 
        dentry = d_alloc_name(dir, "index");
        if (!dentry)
@@ -1937,9 +1936,7 @@ static int sel_make_class_dir_entries(struct selinux_policy *newpolicy,
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
 
-       rc = sel_make_perm_files(newpolicy, classname, index, dentry);
-
-       return rc;
+       return sel_make_perm_files(newpolicy, classname, index, dentry);
 }
 
 static int sel_make_classes(struct selinux_policy *newpolicy,