diff options
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/chainiv.c | 10 | ||||
| -rw-r--r-- | crypto/tcrypt.c | 10 |
2 files changed, 9 insertions, 11 deletions
diff --git a/crypto/chainiv.c b/crypto/chainiv.c index 6da3f577e4db..9affadee3287 100644 --- a/crypto/chainiv.c +++ b/crypto/chainiv.c | |||
| @@ -117,6 +117,7 @@ static int chainiv_init(struct crypto_tfm *tfm) | |||
| 117 | static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) | 117 | static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) |
| 118 | { | 118 | { |
| 119 | int queued; | 119 | int queued; |
| 120 | int err = ctx->err; | ||
| 120 | 121 | ||
| 121 | if (!ctx->queue.qlen) { | 122 | if (!ctx->queue.qlen) { |
| 122 | smp_mb__before_clear_bit(); | 123 | smp_mb__before_clear_bit(); |
| @@ -131,7 +132,7 @@ static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) | |||
| 131 | BUG_ON(!queued); | 132 | BUG_ON(!queued); |
| 132 | 133 | ||
| 133 | out: | 134 | out: |
| 134 | return ctx->err; | 135 | return err; |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | static int async_chainiv_postpone_request(struct skcipher_givcrypt_request *req) | 138 | static int async_chainiv_postpone_request(struct skcipher_givcrypt_request *req) |
| @@ -227,6 +228,7 @@ static void async_chainiv_do_postponed(struct work_struct *work) | |||
| 227 | postponed); | 228 | postponed); |
| 228 | struct skcipher_givcrypt_request *req; | 229 | struct skcipher_givcrypt_request *req; |
| 229 | struct ablkcipher_request *subreq; | 230 | struct ablkcipher_request *subreq; |
| 231 | int err; | ||
| 230 | 232 | ||
| 231 | /* Only handle one request at a time to avoid hogging keventd. */ | 233 | /* Only handle one request at a time to avoid hogging keventd. */ |
| 232 | spin_lock_bh(&ctx->lock); | 234 | spin_lock_bh(&ctx->lock); |
| @@ -241,7 +243,11 @@ static void async_chainiv_do_postponed(struct work_struct *work) | |||
| 241 | subreq = skcipher_givcrypt_reqctx(req); | 243 | subreq = skcipher_givcrypt_reqctx(req); |
| 242 | subreq->base.flags |= CRYPTO_TFM_REQ_MAY_SLEEP; | 244 | subreq->base.flags |= CRYPTO_TFM_REQ_MAY_SLEEP; |
| 243 | 245 | ||
| 244 | async_chainiv_givencrypt_tail(req); | 246 | err = async_chainiv_givencrypt_tail(req); |
| 247 | |||
| 248 | local_bh_disable(); | ||
| 249 | skcipher_givcrypt_complete(req, err); | ||
| 250 | local_bh_enable(); | ||
| 245 | } | 251 | } |
| 246 | 252 | ||
| 247 | static int async_chainiv_init(struct crypto_tfm *tfm) | 253 | static int async_chainiv_init(struct crypto_tfm *tfm) |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 6beabc5abd07..e47f6e02133c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
| @@ -586,12 +586,6 @@ static void test_cipher(char *algo, int enc, | |||
| 586 | j = 0; | 586 | j = 0; |
| 587 | for (i = 0; i < tcount; i++) { | 587 | for (i = 0; i < tcount; i++) { |
| 588 | 588 | ||
| 589 | data = kzalloc(template[i].ilen, GFP_KERNEL); | ||
| 590 | if (!data) | ||
| 591 | continue; | ||
| 592 | |||
| 593 | memcpy(data, template[i].input, template[i].ilen); | ||
| 594 | |||
| 595 | if (template[i].iv) | 589 | if (template[i].iv) |
| 596 | memcpy(iv, template[i].iv, MAX_IVLEN); | 590 | memcpy(iv, template[i].iv, MAX_IVLEN); |
| 597 | else | 591 | else |
| @@ -613,10 +607,8 @@ static void test_cipher(char *algo, int enc, | |||
| 613 | printk("setkey() failed flags=%x\n", | 607 | printk("setkey() failed flags=%x\n", |
| 614 | crypto_ablkcipher_get_flags(tfm)); | 608 | crypto_ablkcipher_get_flags(tfm)); |
| 615 | 609 | ||
| 616 | if (!template[i].fail) { | 610 | if (!template[i].fail) |
| 617 | kfree(data); | ||
| 618 | goto out; | 611 | goto out; |
| 619 | } | ||
| 620 | } | 612 | } |
| 621 | 613 | ||
| 622 | temp = 0; | 614 | temp = 0; |
