]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ima: Fix fall-through warnings for Clang
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 20 Nov 2020 18:25:46 +0000 (12:25 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:01 +0000 (11:41 +0100)
[ Upstream commit dd36925f7987c0854d067eca4d4ee6d3e40cfd45 ]

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: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Stable-dep-of: c7423dbdbc9e ("ima: Handle -ESTALE returned by ima_filter_rule_match()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/integrity/ima/ima_main.c
security/integrity/ima/ima_policy.c

index a768f37a0a4de93a77d0eda3cf813aa493b51dc9..ce9d594ddbcd3eac87910bf9db1b3214ef890ac0 100644 (file)
@@ -615,6 +615,7 @@ int ima_load_data(enum kernel_load_data_id id)
                        pr_err("impossible to appraise a module without a file descriptor. sig_enforce kernel parameter might help\n");
                        return -EACCES; /* INTEGRITY_UNKNOWN */
                }
+               break;
        default:
                break;
        }
index 6cd2f663643c54ffd90c3167a8649498f245922c..7f352e85ffad4923a7de9ec36fe36fbfabedb8ca 100644 (file)
@@ -434,6 +434,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode,
                        rc = ima_filter_rule_match(secid, rule->lsm[i].type,
                                                   Audit_equal,
                                                   rule->lsm[i].rule);
+                       break;
                default:
                        break;
                }
@@ -666,6 +667,7 @@ void __init ima_init_policy(void)
                add_rules(default_measurement_rules,
                          ARRAY_SIZE(default_measurement_rules),
                          IMA_DEFAULT_POLICY);
+               break;
        default:
                break;
        }