summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-15 05:15:19 -0500
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:29:11 -0400
commit442ca4d656645505346017c37ac137cde680bf38 (patch)
treec6e88aeb2b32fd09fd3b99f367040ac3df00840b /security/selinux/ss
parentdf4a14dfb484f95d81126e481e66b6e22eec49e8 (diff)
selinux: Return directly after a failed kzalloc() in common_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/ss')
-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 edf173ed05f8..99ee0ee2d92a 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -1152,10 +1152,9 @@ static int common_read(struct policydb *p, struct hashtab *h, void *fp)
1152 u32 len, nel; 1152 u32 len, nel;
1153 int i, rc; 1153 int i, rc;
1154 1154
1155 rc = -ENOMEM;
1156 comdatum = kzalloc(sizeof(*comdatum), GFP_KERNEL); 1155 comdatum = kzalloc(sizeof(*comdatum), GFP_KERNEL);
1157 if (!comdatum) 1156 if (!comdatum)
1158 goto bad; 1157 return -ENOMEM;
1159 1158
1160 rc = next_entry(buf, fp, sizeof buf); 1159 rc = next_entry(buf, fp, sizeof buf);
1161 if (rc) 1160 if (rc)