crypto: inside-secure - fix use of the SG list
authorAntoine Tenart <antoine.tenart@bootlin.com>
Mon, 27 May 2019 14:51:05 +0000 (16:51 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 6 Jun 2019 06:38:56 +0000 (14:38 +0800)
commit583d7e195f48753c5da8cc75a8ed332cad7287b0
treec8c287d4c6d5b224a765b33acd97fd76df2cccab
parent082ec2d48467b61aa89783e954645ec441714c4e
crypto: inside-secure - fix use of the SG list

Replace sg_nents_for_len by sg_nents when DMA mapping/unmapping buffers
and when looping over the SG entries. This fix cases where the SG
entries aren't used fully, which would in such cases led to using fewer
SG entries than needed (and thus the engine wouldn't have access to the
full input data and the result would be wrong).

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_cipher.c
drivers/crypto/inside-secure/safexcel_hash.c