crypto: sahara - fix processing hash requests with req->nbytes < sg->length
authorOvidiu Panait <ovidiu.panait@windriver.com>
Sun, 24 Dec 2023 08:21:35 +0000 (10:21 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 Dec 2023 03:25:56 +0000 (11:25 +0800)
commit7bafa74d1ba35dcc173e1ce915e983d65905f77e
tree2168a7b1ac9841984bd82a826df4b0623685d7a9
parent5deff027fca49a1eb3b20359333cf2ae562a2343
crypto: sahara - fix processing hash requests with req->nbytes < sg->length

It's not always the case that the entire sg entry needs to be processed.
Currently, when nbytes is less than sg->length, "Descriptor length" errors
are encountered.

To fix this, take the actual request size into account when populating the
hw links.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sahara.c