Skip to content

Commit

Permalink
security/integrity: remove unnecessary 'init_keyring' variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
  • Loading branch information
ebiggers authored and mimizohar committed Oct 10, 2018
1 parent b2724d5 commit 2ab5daf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions security/integrity/digsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ static const char * const keyring_name[INTEGRITY_KEYRING_MAX] = {
"_module",
};

#ifdef CONFIG_INTEGRITY_TRUSTED_KEYRING
static bool init_keyring __initdata = true;
#else
static bool init_keyring __initdata;
#endif

#ifdef CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY
#define restrict_link_to_ima restrict_link_by_builtin_and_secondary_trusted
#else
Expand Down Expand Up @@ -85,7 +79,7 @@ int __init integrity_init_keyring(const unsigned int id)
struct key_restriction *restriction;
int err = 0;

if (!init_keyring)
if (!IS_ENABLED(CONFIG_INTEGRITY_TRUSTED_KEYRING))
return 0;

restriction = kzalloc(sizeof(struct key_restriction), GFP_KERNEL);
Expand Down

0 comments on commit 2ab5daf

Please sign in to comment.