diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2019-09-17 16:55:46 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2019-09-17 16:55:46 +0200 |
commit | cd0060a616b965de788837d822ce0bc3a29b9ce3 (patch) | |
tree | b5f54289d131eec4df749a3fc8354ad89224b2bc /drivers/crypto/sunxi-ss/sun4i-ss-hash.c | |
parent | 29a41bb38356b99a17b82a7652752b9f25959919 (diff) | |
parent | 6b774eec1f9d3064e9b33634dfa99d5666d0a73a (diff) |
Merge remote-tracking branch 'fslc/4.14-2.0.x-imx' into toradex_4.14-2.0.x-imx-next
Diffstat (limited to 'drivers/crypto/sunxi-ss/sun4i-ss-hash.c')
-rw-r--r-- | drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c index a4b5ff2b72f8..f6936bb3b7be 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c @@ -240,7 +240,10 @@ static int sun4i_hash(struct ahash_request *areq) } } else { /* Since we have the flag final, we can go up to modulo 4 */ - end = ((areq->nbytes + op->len) / 4) * 4 - op->len; + if (areq->nbytes < 4) + end = 0; + else + end = ((areq->nbytes + op->len) / 4) * 4 - op->len; } /* TODO if SGlen % 4 and !op->len then DMA */ |