Skip to contentSkip to conversation

crypto: ccp - add missing release in ccp_dmaengine_register

PATCH In review Quentin Lambert 2 participants 2 messages Sep 2, 2016 – Sep 7, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: ccp - add missing release in ccp_dmaengine_register

ccp_dmaengine_register used to return with an error code before releasing all resource. This patch adds a jump to the appropriate label ensuring that the resources are properly released before returning.

This issue was found with Hector.

---
 drivers/crypto/ccp/ccp-dmaengine.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/crypto/ccp/ccp-dmaengine.c +5 -2
@@ -650,8 +650,11 @@ int ccp_dmaengine_register(struct ccp_de
 	dma_desc_cache_name = devm_kasprintf(ccp->dev, GFP_KERNEL,
 					     "%s-dmaengine-desc-cache",
 					     ccp->name);
-	if (!dma_cmd_cache_name)
-		return -ENOMEM;
+	if (!dma_cmd_cache_name) {
+		ret = -ENOMEM;
+		goto err_cache;
+	}
+
 	ccp->dma_desc_cache = kmem_cache_create(dma_desc_cache_name,
 						sizeof(struct ccp_dma_desc),
 						sizeof(void *),
maintainer
#1 lore raw
Quoted 7 lines · Quentin Lambert

ccp_dmaengine_register used to return with an error code before releasing all resource. This patch adds a jump to the appropriate label ensuring that the resources are properly released before returning.

This issue was found with Hector.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt