Skip to content

Commit 28073eb

Browse files
GustavoARSilvamimizohar
authored andcommitted
ima: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case. Link: KSPP#115 Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
1 parent 282c0a4 commit 28073eb

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

security/integrity/ima/ima_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ int ima_load_data(enum kernel_load_data_id id, bool contents)
786786
pr_err("impossible to appraise a module without a file descriptor. sig_enforce kernel parameter might help\n");
787787
return -EACCES; /* INTEGRITY_UNKNOWN */
788788
}
789+
break;
789790
default:
790791
break;
791792
}

security/integrity/ima/ima_policy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule,
599599
rc = ima_filter_rule_match(secid, rule->lsm[i].type,
600600
Audit_equal,
601601
rule->lsm[i].rule);
602+
break;
602603
default:
603604
break;
604605
}
@@ -836,6 +837,7 @@ void __init ima_init_policy(void)
836837
add_rules(default_measurement_rules,
837838
ARRAY_SIZE(default_measurement_rules),
838839
IMA_DEFAULT_POLICY);
840+
break;
839841
default:
840842
break;
841843
}

0 commit comments

Comments
 (0)