summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-10-29 11:32:30 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2019-11-08 23:00:46 +0800
commita970429366ceface03beded582b911277f8f2570 (patch)
treeda7f561c92a307d680f0c5ebc0476c50aea39f72 /drivers
parentd832a6128558503feb6ab18ac6e2cdefbc32e5a9 (diff)
downloadlinux-stable-a970429366ceface03beded582b911277f8f2570.tar.gz
linux-stable-a970429366ceface03beded582b911277f8f2570.tar.bz2
linux-stable-a970429366ceface03beded582b911277f8f2570.zip
crypto: amlogic - ensure error variable err is set before returning it
Currently when the call to crypto_engine_alloc_init fails the error return path returns an uninitialized value in the variable err. Fix this by setting err to -ENOMEM. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/amlogic/amlogic-gxl-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c
index db5b421e88d8..fa05fce1c0de 100644
--- a/drivers/crypto/amlogic/amlogic-gxl-core.c
+++ b/drivers/crypto/amlogic/amlogic-gxl-core.c
@@ -162,6 +162,7 @@ static int meson_allocate_chanlist(struct meson_dev *mc)
if (!mc->chanlist[i].engine) {
dev_err(mc->dev, "Cannot allocate engine\n");
i--;
+ err = -ENOMEM;
goto error_engine;
}
err = crypto_engine_start(mc->chanlist[i].engine);