summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-14 16:15:54 -0500
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:20:07 -0400
commit549fe69ee5c7a7f55c34555032961a2265e6e713 (patch)
tree2652c1314b80ba8f261cf69f26927edda4ea2169 /security
parent4bd9f07b89f1a300f96b4863c3a8a4ec36991930 (diff)
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>
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 9a90953974b8..fd58de5a83ad 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)
1469 __le32 buf[4]; 1469 __le32 buf[4];
1470 u32 len; 1470 u32 len;
1471 1471
1472 rc = -ENOMEM;
1473 typdatum = kzalloc(sizeof(*typdatum), GFP_KERNEL); 1472 typdatum = kzalloc(sizeof(*typdatum), GFP_KERNEL);
1474 if (!typdatum) 1473 if (!typdatum)
1475 goto bad; 1474 return -ENOMEM;
1476 1475
1477 if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) 1476 if (p->policyvers >= POLICYDB_VERSION_BOUNDARY)
1478 to_read = 4; 1477 to_read = 4;