]>
Commit | Line | Data |
---|---|---|
bf1e68bf GKH |
1 | From 19ced623db2fe91604d69f7d86b03144c5107739 Mon Sep 17 00:00:00 2001 |
2 | From: Linus Walleij <linus.walleij@linaro.org> | |
3 | Date: Wed, 8 Jun 2016 14:56:39 +0200 | |
4 | Subject: crypto: ux500 - memmove the right size | |
5 | ||
6 | From: Linus Walleij <linus.walleij@linaro.org> | |
7 | ||
8 | commit 19ced623db2fe91604d69f7d86b03144c5107739 upstream. | |
9 | ||
10 | The hash buffer is really HASH_BLOCK_SIZE bytes, someone | |
11 | must have thought that memmove takes n*u32 words by mistake. | |
12 | Tests work as good/bad as before after this patch. | |
13 | ||
14 | Cc: Joakim Bech <joakim.bech@linaro.org> | |
15 | Reported-by: David Binderman <linuxdev.baldrick@gmail.com> | |
16 | Signed-off-by: Linus Walleij <linus.walleij@linaro.org> | |
17 | Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/crypto/ux500/hash/hash_core.c | 4 ++-- | |
22 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
23 | ||
24 | --- a/drivers/crypto/ux500/hash/hash_core.c | |
25 | +++ b/drivers/crypto/ux500/hash/hash_core.c | |
26 | @@ -781,7 +781,7 @@ static int hash_process_data(struct hash | |
27 | &device_data->state); | |
28 | memmove(req_ctx->state.buffer, | |
29 | device_data->state.buffer, | |
30 | - HASH_BLOCK_SIZE / sizeof(u32)); | |
31 | + HASH_BLOCK_SIZE); | |
32 | if (ret) { | |
33 | dev_err(device_data->dev, | |
34 | "%s: hash_resume_state() failed!\n", | |
35 | @@ -832,7 +832,7 @@ static int hash_process_data(struct hash | |
36 | ||
37 | memmove(device_data->state.buffer, | |
38 | req_ctx->state.buffer, | |
39 | - HASH_BLOCK_SIZE / sizeof(u32)); | |
40 | + HASH_BLOCK_SIZE); | |
41 | if (ret) { | |
42 | dev_err(device_data->dev, "%s: hash_save_state() failed!\n", | |
43 | __func__); |