diff options
author | Quentin Lambert <lambert.quentin@gmail.com> | 2016-09-02 11:48:53 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-09-07 21:08:31 +0800 |
commit | ba22a1e2aa8ef7f8467f755cfe44b79784febefe (patch) | |
tree | 96b0794c506b59b3e445f3641f7b6f590491846a /drivers/crypto/ccp | |
parent | ed4767d612fd2c39e2c4c69eba484c1219dcddb6 (diff) | |
download | blackbird-op-linux-ba22a1e2aa8ef7f8467f755cfe44b79784febefe.tar.gz blackbird-op-linux-ba22a1e2aa8ef7f8467f755cfe44b79784febefe.zip |
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.
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp')
-rw-r--r-- | drivers/crypto/ccp/ccp-dmaengine.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c index 94f77b0f9ae7..ded26f46c735 100644 --- a/drivers/crypto/ccp/ccp-dmaengine.c +++ b/drivers/crypto/ccp/ccp-dmaengine.c @@ -650,8 +650,11 @@ int ccp_dmaengine_register(struct ccp_device *ccp) 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 *), |