Skip to content

Commit 6678e29

Browse files
committed
drivers: crupto: stm32: return error for unknown cipher mode
Returns -EINVAL for unknown cipher mode. Signed-off-by: Georgij Černyšiov <[email protected]>
1 parent 729f829 commit 6678e29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/crypto/crypto_stm32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static int crypto_stm32_session_setup(const struct device *dev,
448448
ctx->ops.ctr_crypt_hndlr = crypto_stm32_ctr_encrypt;
449449
break;
450450
default:
451-
break;
451+
return -EINVAL;
452452
}
453453
} else {
454454
switch (mode) {
@@ -471,7 +471,7 @@ static int crypto_stm32_session_setup(const struct device *dev,
471471
ctx->ops.ctr_crypt_hndlr = crypto_stm32_ctr_decrypt;
472472
break;
473473
default:
474-
break;
474+
return -EINVAL;
475475
}
476476
}
477477

0 commit comments

Comments
 (0)