crypto: caam - fix error return code in caam_qi_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 11 Apr 2017 16:04:09 +0000 (16:04 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Apr 2017 12:30:37 +0000 (20:30 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/qi.c

index 45de8fd87774b24acbc2b2472f5318b3a471f9b5..1990ed460c46386def470dbf46b48fa5f42fe5c4 100644 (file)
@@ -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 */