diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c index f6826066ff0c956527b382f5453936afbea8103f..e854862c9337d7ad52f8b4d59f801ec180f6513c 100644 --- a/security/integrity/ima/ima_template.c +++ b/security/integrity/ima/ima_template.c @@ -152,24 +152,6 @@ static int template_desc_init_fields(const char *template_fmt, return result; } -static int __init init_defined_templates(void) -{ - int i = 0; - int result = 0; - - /* Init defined templates. */ - for (i = 0; i < ARRAY_SIZE(defined_templates); i++) { - struct ima_template_desc *template = &defined_templates[i]; - - result = template_desc_init_fields(template->fmt, - &(template->fields), - &(template->num_fields)); - if (result < 0) - return result; - } - return result; -} - struct ima_template_desc *ima_template_desc_current(void) { if (!ima_template) @@ -180,11 +162,9 @@ struct ima_template_desc *ima_template_desc_current(void) int __init ima_init_template(void) { - int result; - - result = init_defined_templates(); - if (result < 0) - return result; + struct ima_template_desc *template = ima_template_desc_current(); - return 0; + return template_desc_init_fields(template->fmt, + &(template->fields), + &(template->num_fields)); }