Commit 5577857f authored by Dan Carpenter's avatar Dan Carpenter Committed by Mimi Zohar

ima: cleanup ima_init_policy() a little

It's a bit easier to read this if we split it up into two for loops.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 1ddd3b4e
...@@ -338,17 +338,13 @@ void __init ima_init_policy(void) ...@@ -338,17 +338,13 @@ void __init ima_init_policy(void)
appraise_entries = ima_use_appraise_tcb ? appraise_entries = ima_use_appraise_tcb ?
ARRAY_SIZE(default_appraise_rules) : 0; ARRAY_SIZE(default_appraise_rules) : 0;
for (i = 0; i < measure_entries + appraise_entries; i++) { for (i = 0; i < measure_entries; i++)
if (i < measure_entries) list_add_tail(&default_rules[i].list, &ima_default_rules);
list_add_tail(&default_rules[i].list,
&ima_default_rules);
else {
int j = i - measure_entries;
list_add_tail(&default_appraise_rules[j].list, for (i = 0; i < appraise_entries; i++) {
list_add_tail(&default_appraise_rules[i].list,
&ima_default_rules); &ima_default_rules);
} }
}
ima_rules = &ima_default_rules; ima_rules = &ima_default_rules;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment