forked from luck/tmp_suning_uos_patched
selinux: fix return value on error in policydb_read()
The value of rc is still zero from the last assignment when the error
path is taken. Fix it by setting it to -ENOMEM before the
hashtab_create() call.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e67b2ec9f6
("selinux: store role transitions in a hash table")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
3348bd33e8
commit
46619b44e4
|
@ -2540,6 +2540,7 @@ int policydb_read(struct policydb *p, void *fp)
|
|||
goto bad;
|
||||
nel = le32_to_cpu(buf[0]);
|
||||
|
||||
rc = -ENOMEM;
|
||||
p->role_tr = hashtab_create(role_trans_hash, role_trans_cmp, nel);
|
||||
if (!p->role_tr)
|
||||
goto bad;
|
||||
|
|
Loading…
Reference in New Issue
Block a user