diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-02-10 08:43:50 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-03-07 05:13:15 +0100 |
commit | 662c1c5618aaf71f99ada3105b99668a503605ae (patch) | |
tree | bbd26beb24ea7a000adc59c6aa07faa31cf5090f /drivers/crypto/keembay | |
parent | crypto: serpent - Fix sparse byte order warnings (diff) | |
download | linux-662c1c5618aaf71f99ada3105b99668a503605ae.tar.xz linux-662c1c5618aaf71f99ada3105b99668a503605ae.zip |
crypto: keembay-ocs-hcu - Fix error return code in kmb_ocs_hcu_probe()
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 472b04444cd3 ("crypto: keembay - Add Keem Bay OCS HCU driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/keembay')
-rw-r--r-- | drivers/crypto/keembay/keembay-ocs-hcu-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/keembay/keembay-ocs-hcu-core.c b/drivers/crypto/keembay/keembay-ocs-hcu-core.c index c4b97b4160e9..322c51a6936f 100644 --- a/drivers/crypto/keembay/keembay-ocs-hcu-core.c +++ b/drivers/crypto/keembay/keembay-ocs-hcu-core.c @@ -1220,8 +1220,10 @@ static int kmb_ocs_hcu_probe(struct platform_device *pdev) /* Initialize crypto engine */ hcu_dev->engine = crypto_engine_alloc_init(dev, 1); - if (!hcu_dev->engine) + if (!hcu_dev->engine) { + rc = -ENOMEM; goto list_del; + } rc = crypto_engine_start(hcu_dev->engine); if (rc) { |