diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-04-07 05:22:11 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2015-05-13 06:07:19 -0400 |
commit | 5577857f8e26e9027271f10daf96361640907300 (patch) | |
tree | a42a8ecdea41994cf32c405534083e4fa4abb43e /security | |
parent | 1ddd3b4e07a4be9fe3f1ce2441b01859154f4358 (diff) |
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_policy.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index d1eefb9d65fb..e86b58d459e6 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c | |||
@@ -338,16 +338,12 @@ void __init ima_init_policy(void) | |||
338 | appraise_entries = ima_use_appraise_tcb ? | 338 | appraise_entries = ima_use_appraise_tcb ? |
339 | ARRAY_SIZE(default_appraise_rules) : 0; | 339 | ARRAY_SIZE(default_appraise_rules) : 0; |
340 | 340 | ||
341 | for (i = 0; i < measure_entries + appraise_entries; i++) { | 341 | for (i = 0; i < measure_entries; i++) |
342 | if (i < measure_entries) | 342 | list_add_tail(&default_rules[i].list, &ima_default_rules); |
343 | list_add_tail(&default_rules[i].list, | 343 | |
344 | &ima_default_rules); | 344 | for (i = 0; i < appraise_entries; i++) { |
345 | else { | 345 | list_add_tail(&default_appraise_rules[i].list, |
346 | int j = i - measure_entries; | 346 | &ima_default_rules); |
347 | |||
348 | list_add_tail(&default_appraise_rules[j].list, | ||
349 | &ima_default_rules); | ||
350 | } | ||
351 | } | 347 | } |
352 | 348 | ||
353 | ima_rules = &ima_default_rules; | 349 | ima_rules = &ima_default_rules; |