From: Roberto Sassu Date: Mon, 27 Jun 2011 11:45:39 +0000 (+0200) Subject: encrypted_keys: avoid dumping the master key if the request fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f91c2c5cfa2950a20265b45bcc13e49ed9e49aac;p=linux-beck.git encrypted_keys: avoid dumping the master key if the request fails Do not dump the master key if an error is encountered during the request. Signed-off-by: Roberto Sassu Acked-by: Gianluca Ramunno Signed-off-by: Mimi Zohar --- diff --git a/security/keys/encrypted.c b/security/keys/encrypted.c index b1cba5bf0a5e..37cd913f18ae 100644 --- a/security/keys/encrypted.c +++ b/security/keys/encrypted.c @@ -378,11 +378,13 @@ static struct key *request_master_key(struct encrypted_key_payload *epayload, } else goto out; - if (IS_ERR(mkey)) + if (IS_ERR(mkey)) { pr_info("encrypted_key: key %s not found", epayload->master_desc); - if (mkey) - dump_master_key(*master_key, *master_keylen); + goto out; + } + + dump_master_key(*master_key, *master_keylen); out: return mkey; }