Commit a9704293 authored by Colin Ian King's avatar Colin Ian King Committed by Herbert Xu

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: 48fe583f ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarCorentin Labbe <clabbe@baylibre.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d832a612
...@@ -162,6 +162,7 @@ static int meson_allocate_chanlist(struct meson_dev *mc) ...@@ -162,6 +162,7 @@ static int meson_allocate_chanlist(struct meson_dev *mc)
if (!mc->chanlist[i].engine) { if (!mc->chanlist[i].engine) {
dev_err(mc->dev, "Cannot allocate engine\n"); dev_err(mc->dev, "Cannot allocate engine\n");
i--; i--;
err = -ENOMEM;
goto error_engine; goto error_engine;
} }
err = crypto_engine_start(mc->chanlist[i].engine); err = crypto_engine_start(mc->chanlist[i].engine);
......
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