]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2b2c63123745310e0390415bb175a6b92b4adbe5
treec8c287d4c6d5b224a765b33acd97fd76df2cccab
parent670f7eec0500f9e2c90af44a4f116113dcc1e9bb
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