linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: ccp - add missing release in ccp_dmaengine_register
@ 2016-09-02  9:48 Quentin Lambert
  2016-09-07 13:21 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Quentin Lambert @ 2016-09-02  9:48 UTC (permalink / raw)
  To: Tom Lendacky, Gary Hook, Herbert Xu, David S. Miller,
	linux-crypto, linux-kernel
  Cc: kernel-janitors, 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.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
---
 drivers/crypto/ccp/ccp-dmaengine.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/crypto/ccp/ccp-dmaengine.c
+++ b/drivers/crypto/ccp/ccp-dmaengine.c
@@ -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 *),

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: ccp - add missing release in ccp_dmaengine_register
  2016-09-02  9:48 [PATCH] crypto: ccp - add missing release in ccp_dmaengine_register Quentin Lambert
@ 2016-09-07 13:21 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2016-09-07 13:21 UTC (permalink / raw)
  To: Quentin Lambert
  Cc: Tom Lendacky, Gary Hook, David S. Miller, linux-crypto,
	linux-kernel, kernel-janitors

On Fri, Sep 02, 2016 at 11:48:53AM +0200, Quentin Lambert wrote:
> 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.
> 
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-07 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02  9:48 [PATCH] crypto: ccp - add missing release in ccp_dmaengine_register Quentin Lambert
2016-09-07 13:21 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).