[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3e08ed08-11a5-6955-5f56-31d0e2f2b8a0@amd.com>
Date: Mon, 24 Jun 2019 14:58:17 +0000
From: Gary R Hook <ghook@....com>
To: "Lendacky, Thomas" <Thomas.Lendacky@....com>,
David Rientjes <rientjes@...gle.com>,
"Hook, Gary" <Gary.Hook@....com>,
Herbert Xu <herbert@...dor.apana.org.au>
CC: "Singh, Brijesh" <brijesh.singh@....com>,
Cfir Cohen <cfir@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>
Subject: Re: [patch] crypto: ccp - Free ccp if initialization fails
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@....com>
>
>>
>> Fixes: 720419f01832 ("crypto: ccp - Introduce the AMD Secure Processor
>> device")
>>
>> Reported-by: Cfir Cohen <cfir@...gle.com>
>> Signed-off-by: David Rientjes <rientjes@...gle.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");
>>
>>
Powered by blists - more mailing lists