mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -605,6 +605,8 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
for_each_sg(assoc, sg, assoc_n, i) {
|
for_each_sg(assoc, sg, assoc_n, i) {
|
||||||
|
if (!sg->length)
|
||||||
|
continue;
|
||||||
bufl->bufers[bufs].addr = dma_map_single(dev,
|
bufl->bufers[bufs].addr = dma_map_single(dev,
|
||||||
sg_virt(sg),
|
sg_virt(sg),
|
||||||
sg->length,
|
sg->length,
|
||||||
|
|
Loading…
Reference in a new issue