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>
This commit is contained in:
parent
b363700ef5
commit
c5736a4067
|
@ -448,7 +448,7 @@ static int init_ixp_crypto(struct device *dev)
|
||||||
if (!npe_running(npe_c)) {
|
if (!npe_running(npe_c)) {
|
||||||
ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
|
ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto npe_release;
|
||||||
if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
|
if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
|
||||||
goto npe_error;
|
goto npe_error;
|
||||||
} else {
|
} else {
|
||||||
|
@ -472,7 +472,8 @@ static int init_ixp_crypto(struct device *dev)
|
||||||
default:
|
default:
|
||||||
printk(KERN_ERR "Firmware of %s lacks crypto support\n",
|
printk(KERN_ERR "Firmware of %s lacks crypto support\n",
|
||||||
npe_name(npe_c));
|
npe_name(npe_c));
|
||||||
return -ENODEV;
|
ret = -ENODEV;
|
||||||
|
goto npe_release;
|
||||||
}
|
}
|
||||||
/* buffer_pool will also be used to sometimes store the hmac,
|
/* buffer_pool will also be used to sometimes store the hmac,
|
||||||
* so assure it is large enough
|
* so assure it is large enough
|
||||||
|
@ -511,6 +512,7 @@ npe_error:
|
||||||
err:
|
err:
|
||||||
dma_pool_destroy(ctx_pool);
|
dma_pool_destroy(ctx_pool);
|
||||||
dma_pool_destroy(buffer_pool);
|
dma_pool_destroy(buffer_pool);
|
||||||
|
npe_release:
|
||||||
npe_release(npe_c);
|
npe_release(npe_c);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue