Skip to contentSkip to conversation

crypto:ccp - Return from init on allocation failure

PATCH In review Hook, Gary 2 participants 2 messages Jul 30, 2019 – Jul 31, 2019

Subsystems (2)
lore
Share & tools
lore

Hook, Gary

author
#0 lore raw

PATCH 1/1 crypto:ccp - Return from init on allocation failure

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")
---
 drivers/crypto/ccp/ccp-dev-v5.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/ccp/ccp-dev-v5.c +1 -0
index f146b51a23a5..3c0f0d0c3153 100644
@@ -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];
Signature · 1 line
2.17.1
#1 lore raw
Quoted 16 lines · Gary

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")
---
  drivers/crypto/ccp/ccp-dev-v5.c | 1 +
  1 file changed, 1 insertion(+)
drivers/crypto/ccp/ccp-dev-v5.c +0 -0
index f146b51a23a5..3c0f0d0c3153 100644

drivers/crypto/ccp/ccp-dev-v5.c static int ccp5_init(struct ccp_device *ccp) · line 809

Quoted 7 lines
drivers/crypto/ccp/ccp-dev-v5.c +1 -0
@@ -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.