From: Gary R Hook <ghook@amd.com>
To: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
David Rientjes <rientjes@google.com>,
"Hook, Gary" <Gary.Hook@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Singh, Brijesh" <brijesh.singh@amd.com>,
Cfir Cohen <cfir@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: [patch] crypto: ccp - Free ccp if initialization fails
Date: Mon, 24 Jun 2019 14:58:17 +0000 [thread overview]
Message-ID: <3e08ed08-11a5-6955-5f56-31d0e2f2b8a0@amd.com> (raw)
In-Reply-To: <15049ef5-c705-037b-b63e-09aa6f098bdf@amd.com>
On 6/24/19 8:04 AM, Lendacky, Thomas wrote:
> On 6/23/19 2:18 PM, David Rientjes wrote:
>> If ccp_dev_init() fails, kfree() the allocated ccp since it will otherwise
>> be leaked.
>
> Not needed. It's allocated with devm_kzalloc(), so it won't be leaked.
>
> Thanks,
> Tom
Nacked-By: Gary R Hook <gary.hook@amd.com>
>
>>
>> Fixes: 720419f01832 ("crypto: ccp - Introduce the AMD Secure Processor
>> device")
>>
>> Reported-by: Cfir Cohen <cfir@google.com>
>> Signed-off-by: David Rientjes <rientjes@google.com>
>> ---
>> drivers/crypto/ccp/ccp-dev.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c
>> --- a/drivers/crypto/ccp/ccp-dev.c
>> +++ b/drivers/crypto/ccp/ccp-dev.c
>> @@ -609,6 +609,7 @@ int ccp_dev_init(struct sp_device *sp)
>>
>> e_err:
>> sp->ccp_data = NULL;
>> + kfree(ccp);
>>
>> dev_notice(dev, "ccp initialization failed\n");
>>
>>
prev parent reply other threads:[~2019-06-24 14:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-23 19:18 David Rientjes
2019-06-24 13:04 ` Lendacky, Thomas
2019-06-24 14:58 ` Gary R Hook [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e08ed08-11a5-6955-5f56-31d0e2f2b8a0@amd.com \
--to=ghook@amd.com \
--cc=Gary.Hook@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=brijesh.singh@amd.com \
--cc=cfir@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®