summaryrefslogtreecommitdiff
path: root/security/selinux
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-15 00:08:22 +0300
committerPaul Moore <paul@paul-moore.com>2017-03-29 18:15:17 +0300
commit4bd9f07b89f1a300f96b4863c3a8a4ec36991930 (patch)
treeb1f0e2e98fb2991a6977a82cc8556a69ab07a5ad /security/selinux
parentb5921191005d050d55cf4f3b10f60110f7ed2c24 (diff)
downloadlinux-4bd9f07b89f1a300f96b4863c3a8a4ec36991930.tar.xz
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>
Diffstat (limited to 'security/selinux')
-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 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)
__le32 buf[3];
u32 len;
- rc = -ENOMEM;
usrdatum = kzalloc(sizeof(*usrdatum), GFP_KERNEL);
if (!usrdatum)
- goto bad;
+ return -ENOMEM;
if (p->policyvers >= POLICYDB_VERSION_BOUNDARY)
to_read = 3;