diff options
| -rw-r--r-- | drivers/crypto/mv_cesa.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index d704ed0e7d3d..3cf303ee3fe3 100644 --- a/drivers/crypto/mv_cesa.c +++ b/drivers/crypto/mv_cesa.c | |||
| @@ -133,7 +133,6 @@ struct mv_req_hash_ctx { | |||
| 133 | int extra_bytes; /* unprocessed bytes in buffer */ | 133 | int extra_bytes; /* unprocessed bytes in buffer */ |
| 134 | enum hash_op op; | 134 | enum hash_op op; |
| 135 | int count_add; | 135 | int count_add; |
| 136 | struct scatterlist dummysg; | ||
| 137 | }; | 136 | }; |
| 138 | 137 | ||
| 139 | static void compute_aes_dec_key(struct mv_ctx *ctx) | 138 | static void compute_aes_dec_key(struct mv_ctx *ctx) |
| @@ -482,7 +481,7 @@ static int count_sgs(struct scatterlist *sl, unsigned int total_bytes) | |||
| 482 | int i = 0; | 481 | int i = 0; |
| 483 | size_t cur_len; | 482 | size_t cur_len; |
| 484 | 483 | ||
| 485 | while (1) { | 484 | while (sl) { |
| 486 | cur_len = sl[i].length; | 485 | cur_len = sl[i].length; |
| 487 | ++i; | 486 | ++i; |
| 488 | if (total_bytes > cur_len) | 487 | if (total_bytes > cur_len) |
| @@ -711,10 +710,7 @@ static int mv_hash_update(struct ahash_request *req) | |||
| 711 | static int mv_hash_final(struct ahash_request *req) | 710 | static int mv_hash_final(struct ahash_request *req) |
| 712 | { | 711 | { |
| 713 | struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); | 712 | struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); |
| 714 | /* dummy buffer of 4 bytes */ | 713 | |
| 715 | sg_init_one(&ctx->dummysg, ctx->buffer, 4); | ||
| 716 | /* I think I'm allowed to do that... */ | ||
| 717 | ahash_request_set_crypt(req, &ctx->dummysg, req->result, 0); | ||
| 718 | mv_update_hash_req_ctx(ctx, 1, 0); | 714 | mv_update_hash_req_ctx(ctx, 1, 0); |
| 719 | return mv_handle_req(&req->base); | 715 | return mv_handle_req(&req->base); |
| 720 | } | 716 | } |
