Skip to contentSkip to conversation

selinux: Remove the unneeded result variable

PATCH Applied [email protected] 2 participants 2 messages Aug 30, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selinux: Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value sel_make_perm_files() directly instead of storing it in another redundant variable.

---
 security/selinux/selinuxfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
security/selinux/selinuxfs.c +1 -4
index 8fcdd494af27..66610eb3d317 100644
@@ -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,
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 11 lines · On Tue, Aug 30, 2022 at 4:41 AM <[email protected]> wrote:

From: ye xingchen <[email protected]>

Return the value sel_make_perm_files() directly instead of storing it in another redundant variable.

---
 security/selinux/selinuxfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Merged into selinux/next, thanks.

Signature · 1 line
paul-moore.com