diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-14 22:20:25 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 11:22:12 -0400 |
commit | ea6e2f7d12921f336def7398805ee3b1619e2f4b (patch) | |
tree | 23ed586540721a9e34ebcc8e87895ec61996ee0b | |
parent | 549fe69ee5c7a7f55c34555032961a2265e6e713 (diff) | |
download | linux-ea6e2f7d12921f336def7398805ee3b1619e2f4b.tar.bz2 |
selinux: Return directly after a failed kzalloc() in role_read()
Return directly after a call of the function "kzalloc" failed
at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | security/selinux/ss/policydb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index fd58de5a83ad..30f29c669e32 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1412,10 +1412,9 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp) __le32 buf[3]; u32 len; - rc = -ENOMEM; role = kzalloc(sizeof(*role), GFP_KERNEL); if (!role) - goto bad; + return -ENOMEM; if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) to_read = 3; |