crypto: qat - Prevent dma mapping zero length assoc data

Do not attempt to dma map associated data if it is zero length.

Cc: [email protected]
Signed-off-by: Tadeusz Struk <[email protected]>
Tested-by: Nikolay Aleksandrov <[email protected]>
Reviewed-by: Prarit Bhargava <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
Tadeusz Struk 2014-10-13 18:24:26 -07:00 • committed by Herbert Xu
commit 923a6e5e5f

View file

@ -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,