diff mbox

[-next] crypto: caam - fix error return code in caam_qi_init()

Message ID 20170411160409.18430-1-weiyj.lk@gmail.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Wei Yongjun April 11, 2017, 4:04 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return error code -ENOMEM from the kmem_cache_create() error
handling case instead of 0(err is 0 here), as done elsewhere in this
function.

Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/caam/qi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Horia Geanta April 12, 2017, 8:18 a.m. UTC | #1
On 4/11/2017 7:04 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return error code -ENOMEM from the kmem_cache_create() error
> handling case instead of 0(err is 0 here), as done elsewhere in this
> function.
> 
> Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia
Herbert Xu April 21, 2017, 1:14 p.m. UTC | #2
On Tue, Apr 11, 2017 at 04:04:09PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return error code -ENOMEM from the kmem_cache_create() error
> handling case instead of 0(err is 0 here), as done elsewhere in this
> function.
> 
> Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c
index 45de8fd..1990ed4 100644
--- a/drivers/crypto/caam/qi.c
+++ b/drivers/crypto/caam/qi.c
@@ -789,7 +789,7 @@  int caam_qi_init(struct platform_device *caam_pdev)
 		dev_err(qidev, "Can't allocate CAAM cache\n");
 		free_rsp_fqs();
 		platform_device_unregister(qi_pdev);
-		return err;
+		return -ENOMEM;
 	}
 
 	/* Done with the CGRs; restore the cpus allowed mask */