crypto:ccp - Return from init on allocation failure
diff mbox series

Message ID 20190730182738.26432-1-gary.hook@amd.com
State Superseded
Delegated to: Herbert Xu
Headers show
Series
  • crypto:ccp - Return from init on allocation failure
Related show

Commit Message

Gary R Hook July 30, 2019, 6:28 p.m. UTC
Return and fail driver initialization if a DMA pool can't be
allocated.

Fixes: 4b394a232df7 ("crypto: ccp - Let a v5 CCP provide the same function as v3")

Signed-off-by: Gary R Hook <gary.hook@amd.com>
---
 drivers/crypto/ccp/ccp-dev-v5.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gary R Hook July 31, 2019, 4:58 p.m. UTC | #1
On 7/30/19 1:28 PM, Hook, Gary wrote:
> Return and fail driver initialization if a DMA pool can't be
> allocated.
> 
> Fixes: 4b394a232df7 ("crypto: ccp - Let a v5 CCP provide the same function as v3")
> 
> Signed-off-by: Gary R Hook <gary.hook@amd.com>
> ---
>   drivers/crypto/ccp/ccp-dev-v5.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
> index f146b51a23a5..3c0f0d0c3153 100644
> --- a/drivers/crypto/ccp/ccp-dev-v5.c
> +++ b/drivers/crypto/ccp/ccp-dev-v5.c
> @@ -803,6 +803,7 @@ static int ccp5_init(struct ccp_device *ccp)
>   		if (!dma_pool) {
>   			dev_err(dev, "unable to allocate dma pool\n");
>   			ret = -ENOMEM;
> +			goto e_pool;
>   		}
>   
>   		cmd_q = &ccp->cmd_q[ccp->cmd_q_count];
> 

NAK this, please ignore. I changed the subject in the v2 post; apologies 
for that.

Patch
diff mbox series

diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index f146b51a23a5..3c0f0d0c3153 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -803,6 +803,7 @@  static int ccp5_init(struct ccp_device *ccp)
 		if (!dma_pool) {
 			dev_err(dev, "unable to allocate dma pool\n");
 			ret = -ENOMEM;
+			goto e_pool;
 		}
 
 		cmd_q = &ccp->cmd_q[ccp->cmd_q_count];