From 96271c77bf4d0e059daed2a9faac5490372e3d0d Mon Sep 17 00:00:00 2001 From: Chao Song Date: Tue, 3 Jan 2023 17:59:42 +0800 Subject: [PATCH] drivers: crypto: don't return uninitialized local variable It should never be intended to return an uninitialized variable from a function. Remove the use of the uninitialized variable to fix the bug. Signed-off-by: Chao Song --- drivers/crypto/crypto_intel_sha.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/crypto_intel_sha.c b/drivers/crypto/crypto_intel_sha.c index 7cfae1eb24..8629f987c4 100644 --- a/drivers/crypto/crypto_intel_sha.c +++ b/drivers/crypto/crypto_intel_sha.c @@ -284,7 +284,6 @@ static int intel_sha_compute(struct hash_ctx *ctx, struct hash_pkt *pkt, bool fi static int intel_sha_device_set_hash_type(const struct device *dev, struct hash_ctx *ctx, enum hash_algo algo) { - int ret; int ctx_idx; struct sha_container *self = (struct sha_container *const)(dev)->data; @@ -305,7 +304,7 @@ static int intel_sha_device_set_hash_type(const struct device *dev, struct hash_ sha_sessions[ctx_idx].algo = algo; ctx->hash_hndlr = intel_sha_compute; - return ret; + return 0; } static int intel_sha_device_free(const struct device *dev, struct hash_ctx *ctx)