diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-14 16:08:22 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 11:15:17 -0400 |
commit | 4bd9f07b89f1a300f96b4863c3a8a4ec36991930 (patch) | |
tree | b1f0e2e98fb2991a6977a82cc8556a69ab07a5ad | |
parent | b5921191005d050d55cf4f3b10f60110f7ed2c24 (diff) |
selinux: Return directly after a failed kzalloc() in user_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 4759c22d1ae6..9a90953974b8 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -1544,10 +1544,9 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp) | |||
1544 | __le32 buf[3]; | 1544 | __le32 buf[3]; |
1545 | u32 len; | 1545 | u32 len; |
1546 | 1546 | ||
1547 | rc = -ENOMEM; | ||
1548 | usrdatum = kzalloc(sizeof(*usrdatum), GFP_KERNEL); | 1547 | usrdatum = kzalloc(sizeof(*usrdatum), GFP_KERNEL); |
1549 | if (!usrdatum) | 1548 | if (!usrdatum) |
1550 | goto bad; | 1549 | return -ENOMEM; |
1551 | 1550 | ||
1552 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) | 1551 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) |
1553 | to_read = 3; | 1552 | to_read = 3; |