]> git.karo-electronics.de Git - linux-beck.git/commitdiff
crypto: omap-aes - fix error return code in omap_aes_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 15 Sep 2016 03:27:32 +0000 (03:27 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 22 Sep 2016 10:27:35 +0000 (18:27 +0800)
Fix to return error code -ENOMEM from the crypto_engine_alloc_init()
error handling case instead of 0, as done elsewhere in this function.

Fixes: 0529900a01cb ("crypto: omap-aes - Support crypto engine framework")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-aes.c

index 2033769e8381becf9e120c02b7190bea5aa13393..fe32dd95ae4ff20008baeaaa9a78046b6b6c0ed0 100644 (file)
@@ -1215,8 +1215,10 @@ static int omap_aes_probe(struct platform_device *pdev)
 
        /* Initialize crypto engine */
        dd->engine = crypto_engine_alloc_init(dev, 1);
-       if (!dd->engine)
+       if (!dd->engine) {
+               err = -ENOMEM;
                goto err_engine;
+       }
 
        dd->engine->prepare_cipher_request = omap_aes_prepare_req;
        dd->engine->cipher_one_request = omap_aes_crypt_req;