diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2014-10-13 21:24:26 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-10-24 10:37:33 -0400 |
commit | 923a6e5e5f171317ac8bb462ac4b814fa7880d3c (patch) | |
tree | 0ff41bc4f02479cb4d12a9113b80a2616bef0022 /drivers/crypto/qat | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
crypto: qat - Prevent dma mapping zero length assoc data
Do not attempt to dma map associated data if it is zero length.
Cc: stable@vger.kernel.org
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Tested-by: Nikolay Aleksandrov <nikolay@redhat.com>
Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat')
-rw-r--r-- | drivers/crypto/qat/qat_common/qat_algs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat_common/qat_algs.c index f2e2f158cfbe..699ccf44e9bb 100644 --- a/drivers/crypto/qat/qat_common/qat_algs.c +++ b/drivers/crypto/qat/qat_common/qat_algs.c | |||
@@ -605,6 +605,8 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst, | |||
605 | goto err; | 605 | goto err; |
606 | 606 | ||
607 | for_each_sg(assoc, sg, assoc_n, i) { | 607 | for_each_sg(assoc, sg, assoc_n, i) { |
608 | if (!sg->length) | ||
609 | continue; | ||
608 | bufl->bufers[bufs].addr = dma_map_single(dev, | 610 | bufl->bufers[bufs].addr = dma_map_single(dev, |
609 | sg_virt(sg), | 611 | sg_virt(sg), |
610 | sg->length, | 612 | sg->length, |