Skip to content

Commit a970429

Browse files
Colin Ian Kingherbertx
authored andcommitted
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: 48fe583 ("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>
1 parent d832a61 commit a970429

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎drivers/crypto/amlogic/amlogic-gxl-core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ static int meson_allocate_chanlist(struct meson_dev *mc)
162162
if (!mc->chanlist[i].engine) {
163163
dev_err(mc->dev, "Cannot allocate engine\n");
164164
i--;
165+
err = -ENOMEM;
165166
goto error_engine;
166167
}
167168
err = crypto_engine_start(mc->chanlist[i].engine);

0 commit comments

Comments
 (0)