summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorQuentin Lambert <lambert.quentin@gmail.com>2016-07-22 15:32:41 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2016-08-09 18:47:03 +0800
commitc5736a4067ad4c59d1447762172def7f27fe869a (patch)
tree7e068ae6b0a03c0e755107df4225540358f86518 /drivers/crypto
parentb363700ef50e2c0b3122b47ffba70281f45cb686 (diff)
downloadtalos-obmc-linux-c5736a4067ad4c59d1447762172def7f27fe869a.tar.gz
talos-obmc-linux-c5736a4067ad4c59d1447762172def7f27fe869a.zip
crypto: ixp4xx - Add missing npe_c release in error branches
Most error branches following the call to npe_request contain a call to npe_request. This patch add a call to npe_release to error branches following the call to npe_request that do not have it. 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')
-rw-r--r--drivers/crypto/ixp4xx_crypto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index a6ab2575df28..7868765a70c5 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -448,7 +448,7 @@ static int init_ixp_crypto(struct device *dev)
if (!npe_running(npe_c)) {
ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
if (ret)
- return ret;
+ goto npe_release;
if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
goto npe_error;
} else {
@@ -472,7 +472,8 @@ static int init_ixp_crypto(struct device *dev)
default:
printk(KERN_ERR "Firmware of %s lacks crypto support\n",
npe_name(npe_c));
- return -ENODEV;
+ ret = -ENODEV;
+ goto npe_release;
}
/* buffer_pool will also be used to sometimes store the hmac,
* so assure it is large enough
@@ -511,6 +512,7 @@ npe_error:
err:
dma_pool_destroy(ctx_pool);
dma_pool_destroy(buffer_pool);
+npe_release:
npe_release(npe_c);
return ret;
}
OpenPOWER on IntegriCloud