summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-14 22:30:51 +0100
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:24:58 -0400
commitdf4a14dfb484f95d81126e481e66b6e22eec49e8 (patch)
tree5a55b06d3b497b9a101e5986391e95af38c4ac0c /security
parentea6e2f7d12921f336def7398805ee3b1619e2f4b (diff)
downloadlinux-df4a14dfb484f95d81126e481e66b6e22eec49e8.tar.gz
linux-df4a14dfb484f95d81126e481e66b6e22eec49e8.tar.bz2
linux-df4a14dfb484f95d81126e481e66b6e22eec49e8.zip
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>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/policydb.c3
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)