diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-15 00:30:51 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 18:24:58 +0300 |
commit | df4a14dfb484f95d81126e481e66b6e22eec49e8 (patch) | |
tree | 5a55b06d3b497b9a101e5986391e95af38c4ac0c | |
parent | ea6e2f7d12921f336def7398805ee3b1619e2f4b (diff) | |
download | linux-df4a14dfb484f95d81126e481e66b6e22eec49e8.tar.xz |
selinux: Return directly after a failed kzalloc() in class_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 30f29c669e32..edf173ed05f8 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1318,10 +1318,9 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp) u32 len, len2, ncons, nel; int i, rc; - rc = -ENOMEM; cladatum = kzalloc(sizeof(*cladatum), GFP_KERNEL); if (!cladatum) - goto bad; + return -ENOMEM; rc = next_entry(buf, fp, sizeof(u32)*6); if (rc) |