summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-14 22:15:54 +0100
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:20:07 -0400
commit549fe69ee5c7a7f55c34555032961a2265e6e713 (patch)
tree2652c1314b80ba8f261cf69f26927edda4ea2169
parent4bd9f07b89f1a300f96b4863c3a8a4ec36991930 (diff)
downloadop-kernel-dev-549fe69ee5c7a7f55c34555032961a2265e6e713.zip
op-kernel-dev-549fe69ee5c7a7f55c34555032961a2265e6e713.tar.gz
selinux: Return directly after a failed kzalloc() in type_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.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 9a90953..fd58de5 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -1469,10 +1469,9 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
__le32 buf[4];
u32 len;
- rc = -ENOMEM;
typdatum = kzalloc(sizeof(*typdatum), GFP_KERNEL);
if (!typdatum)
- goto bad;
+ return -ENOMEM;
if (p->policyvers >= POLICYDB_VERSION_BOUNDARY)
to_read = 4;
OpenPOWER on IntegriCloud