Skip to content

Commit

Permalink
crypto: qat - Prevent dma mapping zero length assoc data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tadeusz Struk authored and Herbert Xu committed Oct 24, 2014
1 parent f114040 commit 923a6e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/crypto/qat/qat_common/qat_algs.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
goto err;

for_each_sg(assoc, sg, assoc_n, i) {
if (!sg->length)
continue;
bufl->bufers[bufs].addr = dma_map_single(dev,
sg_virt(sg),
sg->length,
Expand Down

0 comments on commit 923a6e5

Please sign in to comment.