forked from luck/tmp_suning_uos_patched
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: c7c556f1e8
("selinux: refactor changing booleans")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
c7c556f1e8
commit
69ea651c40
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user