Commit 923a6e5e authored by Tadeusz Struk's avatar Tadeusz Struk Committed by Herbert Xu

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: default avatarTadeusz Struk <tadeusz.struk@intel.com>
Tested-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
Reviewed-by: default avatarPrarit Bhargava <prarit@redhat.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f114040e
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment