[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1906231217040.15277@chino.kir.corp.google.com>
Date: Sun, 23 Jun 2019 12:18:44 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Tom Lendacky <thomas.lendacky@....com>,
Gary Hook <gary.hook@....com>,
Herbert Xu <herbert@...dor.apana.org.au>
cc: Brijesh Singh <brijesh.singh@....com>,
Cfir Cohen <cfir@...gle.com>, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org
Subject: [patch] crypto: ccp - Free ccp if initialization fails
If ccp_dev_init() fails, kfree() the allocated ccp since it will otherwise
be leaked.
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