diff mbox series

[-next] crypto: qat - use kfree_sensitive instead of memset/kfree()

Message ID 20230802091427.3269183-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [-next] crypto: qat - use kfree_sensitive instead of memset/kfree() | expand

Commit Message

Yang Yingliang Aug. 2, 2023, 9:14 a.m. UTC
Use kfree_sensitive() instead of memset() and kfree().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/crypto/intel/qat/qat_common/qat_compression.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Cabiddu, Giovanni Aug. 3, 2023, 9:19 a.m. UTC | #1
On Wed, Aug 02, 2023 at 05:14:27PM +0800, Yang Yingliang wrote:
> Use kfree_sensitive() instead of memset() and kfree().
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Herbert Xu Aug. 11, 2023, 11:29 a.m. UTC | #2
On Wed, Aug 02, 2023 at 05:14:27PM +0800, Yang Yingliang wrote:
> Use kfree_sensitive() instead of memset() and kfree().
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/crypto/intel/qat/qat_common/qat_compression.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/intel/qat/qat_common/qat_compression.c b/drivers/crypto/intel/qat/qat_common/qat_compression.c
index 3f1f35283266..7842a9f22178 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_compression.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_compression.c
@@ -234,8 +234,7 @@  static void qat_free_dc_data(struct adf_accel_dev *accel_dev)
 
 	dma_unmap_single(dev, dc_data->ovf_buff_p, dc_data->ovf_buff_sz,
 			 DMA_FROM_DEVICE);
-	memset(dc_data->ovf_buff, 0, dc_data->ovf_buff_sz);
-	kfree(dc_data->ovf_buff);
+	kfree_sensitive(dc_data->ovf_buff);
 	devm_kfree(dev, dc_data);
 	accel_dev->dc_data = NULL;
 }