Commit 2eee428d authored by Wei Yongjun's avatar Wei Yongjun Committed by Herbert Xu

crypto: keembay-ocs-aes - Fix error return code in kmb_ocs_aes_probe()

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 88574332 ("crypto: keembay - Add support for Keem Bay OCS AES/SM4")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarDaniele Alessandrelli <daniele.alessandrelli@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 662c1c56
......@@ -1649,8 +1649,10 @@ static int kmb_ocs_aes_probe(struct platform_device *pdev)
/* Initialize crypto engine */
aes_dev->engine = crypto_engine_alloc_init(dev, true);
if (!aes_dev->engine)
if (!aes_dev->engine) {
rc = -ENOMEM;
goto list_del;
}
rc = crypto_engine_start(aes_dev->engine);
if (rc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment