Skip to content

Commit 96271c7

Browse files
Chao Songcarlescufi
Chao Song
authored andcommitted
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 <[email protected]>
1 parent c7a5f7f commit 96271c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/crypto/crypto_intel_sha.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ static int intel_sha_compute(struct hash_ctx *ctx, struct hash_pkt *pkt, bool fi
284284
static int intel_sha_device_set_hash_type(const struct device *dev, struct hash_ctx *ctx,
285285
enum hash_algo algo)
286286
{
287-
int ret;
288287
int ctx_idx;
289288
struct sha_container *self = (struct sha_container *const)(dev)->data;
290289

@@ -305,7 +304,7 @@ static int intel_sha_device_set_hash_type(const struct device *dev, struct hash_
305304
sha_sessions[ctx_idx].algo = algo;
306305

307306
ctx->hash_hndlr = intel_sha_compute;
308-
return ret;
307+
return 0;
309308
}
310309

311310
static int intel_sha_device_free(const struct device *dev, struct hash_ctx *ctx)

0 commit comments

Comments
 (0)