Skip to content

Commit 57cb17e

Browse files
Dan CarpenterJames Morris
authored andcommitted
KEYS: Fix an error code in request_master_key()
This function has two callers and neither are able to handle a NULL return. Really, -EINVAL is the correct thing return here anyway. This fixes some static checker warnings like: security/keys/encrypted-keys/encrypted.c:709 encrypted_key_decrypt() error: uninitialized symbol 'master_key'. Fixes: 7e70cb4 ("keys: add new key-type encrypted") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
1 parent f868801 commit 57cb17e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎security/keys/encrypted-keys/encrypted.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static struct skcipher_request *init_skcipher_req(const u8 *key,
437437
static struct key *request_master_key(struct encrypted_key_payload *epayload,
438438
const u8 **master_key, size_t *master_keylen)
439439
{
440-
struct key *mkey = NULL;
440+
struct key *mkey = ERR_PTR(-EINVAL);
441441

442442
if (!strncmp(epayload->master_desc, KEY_TRUSTED_PREFIX,
443443
KEY_TRUSTED_PREFIX_LEN)) {

0 commit comments

Comments
 (0)