Message ID | a9edf310-0edb-0dc7-f623-164ee9c7f102@users.sourceforge.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c index d7f282d75cc1..71bc204e2ee8 100644 --- a/security/integrity/evm/evm_crypto.c +++ b/security/integrity/evm/evm_crypto.c @@ -53,12 +53,14 @@ int evm_set_key(void *key, size_t keylen) { int rc; - rc = -EBUSY; - if (test_and_set_bit(EVM_SET_KEY_BUSY, &evm_set_key_flags)) + if (test_and_set_bit(EVM_SET_KEY_BUSY, &evm_set_key_flags)) { + rc = -EBUSY; goto busy; - rc = -EINVAL; - if (keylen > MAX_KEY_SIZE) + } + if (keylen > MAX_KEY_SIZE) { + rc = -EINVAL; goto inval; + } memcpy(evmkey, key, keylen); evm_initialized |= EVM_INIT_HMAC; pr_info("key initialized\n");