diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-06-14 16:12:40 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-06-14 16:12:40 +0200 |
commit | b1d622fc5293ae805065a0fe3bf74cc2cc1bc5f4 (patch) | |
tree | 6b984a37fa4e4acdb9512719c7de1e84610a6242 /crypto/drbg.c | |
parent | 4c6427919ee920d5963cf826de76292286342aa0 (diff) | |
parent | 0930c08c6bc50a3a62ee3c90fad305840affbaf2 (diff) | |
download | linux-crypto-b1d622fc5293ae805065a0fe3bf74cc2cc1bc5f4.tar.gz linux-crypto-b1d622fc5293ae805065a0fe3bf74cc2cc1bc5f4.zip |
Merge tag 'v4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Linux 4.12-rc5
Diffstat (limited to '')
-rw-r--r-- | crypto/drbg.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c index 8a4d98b4..cdb27ac4 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1749,17 +1749,16 @@ static int drbg_kcapi_sym_ctr(struct drbg_state *drbg, u8 *inbuf, u32 inlen, u8 *outbuf, u32 outlen) { - struct scatterlist sg_in; + struct scatterlist sg_in, sg_out; int ret; sg_init_one(&sg_in, inbuf, inlen); + sg_init_one(&sg_out, drbg->outscratchpad, DRBG_OUTSCRATCHLEN); while (outlen) { u32 cryptlen = min3(inlen, outlen, (u32)DRBG_OUTSCRATCHLEN); - struct scatterlist sg_out; /* Output buffer may not be valid for SGL, use scratchpad */ - sg_init_one(&sg_out, drbg->outscratchpad, cryptlen); skcipher_request_set_crypt(drbg->ctr_req, &sg_in, &sg_out, cryptlen, drbg->V); ret = crypto_skcipher_encrypt(drbg->ctr_req); @@ -1768,9 +1767,8 @@ static int drbg_kcapi_sym_ctr(struct drbg_state *drbg, break; case -EINPROGRESS: case -EBUSY: - ret = wait_for_completion_interruptible( - &drbg->ctr_completion); - if (!ret && !drbg->ctr_async_err) { + wait_for_completion(&drbg->ctr_completion); + if (!drbg->ctr_async_err) { reinit_completion(&drbg->ctr_completion); break; } |