Skip to content

Commit a1f613f

Browse files
Cyrille Pitchenherbertx
authored andcommitted
crypto: atmel-aes - fix atmel_aes_handle_queue()
This patch fixes the value returned by atmel_aes_handle_queue(), which could have been wrong previously when the crypto request was started synchronously but became asynchronous during the ctx->start() call. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 81d8750 commit a1f613f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/crypto/atmel-aes.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ static int atmel_aes_handle_queue(struct atmel_aes_dev *dd,
879879
struct crypto_async_request *areq, *backlog;
880880
struct atmel_aes_base_ctx *ctx;
881881
unsigned long flags;
882+
bool start_async;
882883
int err, ret = 0;
883884

884885
spin_lock_irqsave(&dd->lock, flags);
@@ -904,10 +905,12 @@ static int atmel_aes_handle_queue(struct atmel_aes_dev *dd,
904905

905906
dd->areq = areq;
906907
dd->ctx = ctx;
907-
dd->is_async = (areq != new_areq);
908+
start_async = (areq != new_areq);
909+
dd->is_async = start_async;
908910

911+
/* WARNING: ctx->start() MAY change dd->is_async. */
909912
err = ctx->start(dd);
910-
return (dd->is_async) ? ret : err;
913+
return (start_async) ? ret : err;
911914
}
912915

913916

0 commit comments

Comments
 (0)