Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642887 > unrolled thread

Re: [PATCH 4/4] crypto: Documentation: fix none signal safe sample

Started byEric Biggers <ebiggers3@gmail.com>
First post2017-05-17 00:50 +0200
Last post2017-05-17 00:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 4/4] crypto: Documentation: fix none signal safe sample Eric Biggers <ebiggers3@gmail.com> - 2017-05-17 00:50 +0200

#1642887 — Re: [PATCH 4/4] crypto: Documentation: fix none signal safe sample

FromEric Biggers <ebiggers3@gmail.com>
Date2017-05-17 00:50 +0200
SubjectRe: [PATCH 4/4] crypto: Documentation: fix none signal safe sample
Message-ID<tHTrX-3gi-7@gated-at.bofh.it>
On Thu, May 11, 2017 at 02:53:45PM +0300, Gilad Ben-Yossef wrote:
> The sample code was showing use of wait_for_completion_interruptible()
> for waiting for an async. crypto op to finish. However, if a signal
> arrived it would free the buffers used even while crypto HW might
> still DMA from/into the buffers.
> 
> Resolve this by using wait_for_completion() instead.
> 
> Reported-by: Eric Biggers <ebiggers3@gmail.com>
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> ---
>  Documentation/crypto/api-samples.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/crypto/api-samples.rst b/Documentation/crypto/api-samples.rst
> index d021fd9..944f08b 100644
> --- a/Documentation/crypto/api-samples.rst
> +++ b/Documentation/crypto/api-samples.rst
> @@ -48,7 +48,7 @@ Code Example For Symmetric Key Cipher Operation
>              break;
>          case -EINPROGRESS:
>          case -EBUSY:
> -            rc = wait_for_completion_interruptible(
> +            rc = wait_for_completion(
>                  &sk->result.completion);
>              if (!rc && !sk->result.err) {
>                  reinit_completion(&sk->result.completion);
> -- 
> 2.1.4
> 

Same issue here: wait_for_completion() doesn't return a value.

Eric

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web