diff options
-rw-r--r-- | drivers/crypto/mv_cesa.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index 49a22060fb5..d0fb10e701c 100644 --- a/drivers/crypto/mv_cesa.c +++ b/drivers/crypto/mv_cesa.c | |||
@@ -184,10 +184,11 @@ static void copy_src_to_buf(struct req_progress *p, char *dbuf, int len) | |||
184 | static void setup_data_in(void) | 184 | static void setup_data_in(void) |
185 | { | 185 | { |
186 | struct req_progress *p = &cpg->p; | 186 | struct req_progress *p = &cpg->p; |
187 | p->crypt_len = | 187 | int data_in_sram = |
188 | min(p->hw_nbytes - p->hw_processed_bytes, cpg->max_req_size); | 188 | min(p->hw_nbytes - p->hw_processed_bytes, cpg->max_req_size); |
189 | copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START, | 189 | copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START + p->crypt_len, |
190 | p->crypt_len); | 190 | data_in_sram - p->crypt_len); |
191 | p->crypt_len = data_in_sram; | ||
191 | } | 192 | } |
192 | 193 | ||
193 | static void mv_process_current_q(int first_block) | 194 | static void mv_process_current_q(int first_block) |
@@ -298,6 +299,7 @@ static void dequeue_complete_req(void) | |||
298 | } while (need_copy_len > 0); | 299 | } while (need_copy_len > 0); |
299 | } | 300 | } |
300 | 301 | ||
302 | cpg->p.crypt_len = 0; | ||
301 | 303 | ||
302 | BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE); | 304 | BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE); |
303 | if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) { | 305 | if (cpg->p.hw_processed_bytes < cpg->p.hw_nbytes) { |