aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/integrity/ima/ima_template.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c
index f6826066ff0c..e854862c9337 100644
--- a/security/integrity/ima/ima_template.c
+++ b/security/integrity/ima/ima_template.c
@@ -152,24 +152,6 @@ out:
152 return result; 152 return result;
153} 153}
154 154
155static int __init init_defined_templates(void)
156{
157 int i = 0;
158 int result = 0;
159
160 /* Init defined templates. */
161 for (i = 0; i < ARRAY_SIZE(defined_templates); i++) {
162 struct ima_template_desc *template = &defined_templates[i];
163
164 result = template_desc_init_fields(template->fmt,
165 &(template->fields),
166 &(template->num_fields));
167 if (result < 0)
168 return result;
169 }
170 return result;
171}
172
173struct ima_template_desc *ima_template_desc_current(void) 155struct ima_template_desc *ima_template_desc_current(void)
174{ 156{
175 if (!ima_template) 157 if (!ima_template)
@@ -180,11 +162,9 @@ struct ima_template_desc *ima_template_desc_current(void)
180 162
181int __init ima_init_template(void) 163int __init ima_init_template(void)
182{ 164{
183 int result; 165 struct ima_template_desc *template = ima_template_desc_current();
184
185 result = init_defined_templates();
186 if (result < 0)
187 return result;
188 166
189 return 0; 167 return template_desc_init_fields(template->fmt,
168 &(template->fields),
169 &(template->num_fields));
190} 170}