crypto: qat - use kfree_sensitive instead of memset/kfree()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 2 Aug 2023 09:14:27 +0000 (17:14 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 11 Aug 2023 11:19:27 +0000 (19:19 +0800)
Use kfree_sensitive() instead of memset() and kfree().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/intel/qat/qat_common/qat_compression.c

index 3f1f352..7842a9f 100644 (file)
@@ -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;
 }