linux-brain/drivers/crypto/qat
Lv Yunlong 19d16a6897 crypto: qat - Fix a double free in adf_create_ring
[ Upstream commit f7cae626cabb3350b23722b78fe34dd7a615ca04 ]

In adf_create_ring, if the callee adf_init_ring() failed, the callee will
free the ring->base_addr by dma_free_coherent() and return -EFAULT. Then
adf_create_ring will goto err and the ring->base_addr will be freed again
in adf_cleanup_ring().

My patch sets ring->base_addr to NULL after the first freed to avoid the
double free.

Fixes: a672a9dc87 ("crypto: qat - Intel(R) QAT transport code")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-14 09:44:20 +02:00
..
qat_c3xxx treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
qat_c3xxxvf crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init 2021-05-14 09:44:18 +02:00
qat_c62x treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
qat_c62xvf crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init 2021-05-14 09:44:18 +02:00
qat_common crypto: qat - Fix a double free in adf_create_ring 2021-05-14 09:44:20 +02:00
qat_dh895xcc treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
qat_dh895xccvf crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init 2021-05-14 09:44:18 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00