summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-14 22:20:25 +0100
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:22:12 -0400
commitea6e2f7d12921f336def7398805ee3b1619e2f4b (patch)
tree23ed586540721a9e34ebcc8e87895ec61996ee0b /security
parent549fe69ee5c7a7f55c34555032961a2265e6e713 (diff)
downloadblackbird-op-linux-ea6e2f7d12921f336def7398805ee3b1619e2f4b.tar.gz
blackbird-op-linux-ea6e2f7d12921f336def7398805ee3b1619e2f4b.zip
selinux: Return directly after a failed kzalloc() in role_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 fd58de5a83ad..30f29c669e32 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -1412,10 +1412,9 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
__le32 buf[3];
u32 len;
- rc = -ENOMEM;
role = kzalloc(sizeof(*role), GFP_KERNEL);
if (!role)
- goto bad;
+ return -ENOMEM;
if (p->policyvers >= POLICYDB_VERSION_BOUNDARY)
to_read = 3;
OpenPOWER on IntegriCloud