mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
f114040e3e
commit
923a6e5e5f
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue