]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - check sg_count() return value
authorHoria Geantă <horia.geanta@nxp.com>
Fri, 10 Feb 2017 12:07:18 +0000 (14:07 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Feb 2017 05:23:39 +0000 (13:23 +0800)
commit8f1b3665f9b4ee0cf9839108d3d0b3e09c164107
tree7d233ab0c8a743332ef4ac426611348ab43f755a
parent1ff7bfbe5150b5f6f7746554f15aa5af9d00c96d
crypto: caam - check sg_count() return value

sg_count() internally calls sg_nents_for_len(), which could fail
in case the required number of bytes is larger than the total
bytes in the S/G.

Thus, add checks to validate the input.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c