summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMarkus Elfring2017-01-14 22:30:51 +0100
committerPaul Moore2017-03-29 17:24:58 +0200
commitdf4a14dfb484f95d81126e481e66b6e22eec49e8 (patch)
tree5a55b06d3b497b9a101e5986391e95af38c4ac0c /security
parentselinux: Return directly after a failed kzalloc() in role_read() (diff)
downloadkernel-qcow2-linux-df4a14dfb484f95d81126e481e66b6e22eec49e8.tar.gz
kernel-qcow2-linux-df4a14dfb484f95d81126e481e66b6e22eec49e8.tar.xz
kernel-qcow2-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)