diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-14 16:20:25 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 11:22:12 -0400 |
commit | ea6e2f7d12921f336def7398805ee3b1619e2f4b (patch) | |
tree | 23ed586540721a9e34ebcc8e87895ec61996ee0b /security | |
parent | 549fe69ee5c7a7f55c34555032961a2265e6e713 (diff) |
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>
Diffstat (limited to 'security')
-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) | |||
1412 | __le32 buf[3]; | 1412 | __le32 buf[3]; |
1413 | u32 len; | 1413 | u32 len; |
1414 | 1414 | ||
1415 | rc = -ENOMEM; | ||
1416 | role = kzalloc(sizeof(*role), GFP_KERNEL); | 1415 | role = kzalloc(sizeof(*role), GFP_KERNEL); |
1417 | if (!role) | 1416 | if (!role) |
1418 | goto bad; | 1417 | return -ENOMEM; |
1419 | 1418 | ||
1420 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) | 1419 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) |
1421 | to_read = 3; | 1420 | to_read = 3; |