Skip to content

Commit 2ab5daf

Browse files
ebiggersmimizohar
authored andcommitted
security/integrity: remove unnecessary 'init_keyring' variable
The 'init_keyring' variable actually just gave the value of CONFIG_INTEGRITY_TRUSTED_KEYRING. We should check the config option directly instead. No change in behavior; this just simplifies the code. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent b2724d5 commit 2ab5daf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

security/integrity/digsig.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ static const char * const keyring_name[INTEGRITY_KEYRING_MAX] = {
3737
"_module",
3838
};
3939

40-
#ifdef CONFIG_INTEGRITY_TRUSTED_KEYRING
41-
static bool init_keyring __initdata = true;
42-
#else
43-
static bool init_keyring __initdata;
44-
#endif
45-
4640
#ifdef CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY
4741
#define restrict_link_to_ima restrict_link_by_builtin_and_secondary_trusted
4842
#else
@@ -85,7 +79,7 @@ int __init integrity_init_keyring(const unsigned int id)
8579
struct key_restriction *restriction;
8680
int err = 0;
8781

88-
if (!init_keyring)
82+
if (!IS_ENABLED(CONFIG_INTEGRITY_TRUSTED_KEYRING))
8983
return 0;
9084

9185
restriction = kzalloc(sizeof(struct key_restriction), GFP_KERNEL);

0 commit comments

Comments
 (0)