Commit bcb62828 authored by Christian Göttsche's avatar Christian Göttsche Committed by Paul Moore
Browse files

selinux: check return value of sel_make_avc_files



sel_make_avc_files() might fail and return a negative errno value on
memory allocation failures. Re-add the check of the return value,
dropped in 66f8e2f0 ("selinux: sidtab reverse lookup hash table").

Reported by clang-analyzer:

    security/selinux/selinuxfs.c:2129:2: warning: Value stored to
      'ret' is never read [deadcode.DeadStores]
            ret = sel_make_avc_files(dentry);
            ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 66f8e2f0 ("selinux: sidtab reverse lookup hash table")
Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
[PM: description line wrapping, added proper commit ref]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 0266c25e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2127,6 +2127,8 @@ static int sel_fill_super(struct super_block *sb, struct fs_context *fc)
	}

	ret = sel_make_avc_files(dentry);
	if (ret)
		goto err;

	dentry = sel_make_dir(sb->s_root, "ss", &fsi->last_ino);
	if (IS_ERR(dentry)) {