On Tue, 2019-06-18 at 13:24 -0700, Matthew Garrett wrote: > @@ -1134,6 +1144,27 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > else > entry->flags |= IMA_PCR; > > + break; > + case Opt_template: > + ima_log_string(ab, "template", args[0].from); > + if (entry->action != MEASURE) { > + result = -EINVAL; > + break; > + } > + template_desc = lookup_template_desc(args[0].from); > + if (!template_desc || entry->template) { > + result = -EINVAL; > + } else { > + /* > + * template_desc_init_fields() does nothing > + * if the template is already initialised, > + * so it's safe to do this unconditionally > + */ > + template_desc_init_fields(template_desc->fmt, > + &(template_desc->fields), > + &(template_desc->num_fields)); > + entry->template = template_desc; > + } The "else" isn't necessary, causing unnecessary indenting. Just add a break. Mimi > break; > case Opt_err: > ima_log_string(ab, "UNKNOWN", p);