Commit 69ea651c authored by Colin Ian King's avatar Colin Ian King Committed by Paul Moore

selinux: fix allocation failure check on newpolicy->sidtab

The allocation check of newpolicy->sidtab is null checking if
newpolicy is null and not newpolicy->sidtab. Fix this.

Addresses-Coverity: ("Logically dead code")
Fixes: c7c556f1 ("selinux: refactor changing booleans")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarStephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent c7c556f1
......@@ -2224,7 +2224,7 @@ int security_load_policy(struct selinux_state *state, void *data, size_t len,
return -ENOMEM;
newpolicy->sidtab = kzalloc(sizeof(*newpolicy->sidtab), GFP_KERNEL);
if (!newpolicy)
if (!newpolicy->sidtab)
goto err;
rc = policydb_read(&newpolicy->policydb, fp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment