mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
crypto: atmel-sha - reject initialization without a device
A transform may be initialized for the first time after the last
device has been removed from the driver list. Return -ENODEV when the
lookup is empty, before the debug message reads dd->dev.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: ebc82efa1c ("crypto: atmel - add Atmel SHA1/SHA256 driver")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
be51ea091c
commit
a9a2152d29
|
|
@ -422,6 +422,9 @@ static int atmel_sha_init(struct ahash_request *req)
|
|||
struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
|
||||
struct atmel_sha_dev *dd = atmel_sha_find_dev(tctx);
|
||||
|
||||
if (!dd)
|
||||
return -ENODEV;
|
||||
|
||||
ctx->dd = dd;
|
||||
|
||||
ctx->flags = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user