2019-09-04 03:05:45

by zhong jiang

[permalink] [raw]
Subject: [PATCH 0/3] Use kzfree instead of memset() + kfree()

th the help of Coccinelle. We find some place to replace.

@@
expression M, S;
@@

- memset(M, 0, S);
- kfree(M);
+ kzfree(M);

zhong jiang (3):
crypto: marvell: Use kzfree rather than its implementation
iommu/pamu: Use kzfree rather than its implementation
Staging: rtl8723bs: Use kzfree rather than its implementation

drivers/crypto/marvell/hash.c | 3 +--
drivers/iommu/fsl_pamu.c | 6 ++----
drivers/staging/rtl8723bs/core/rtw_security.c | 3 +--
3 files changed, 4 insertions(+), 8 deletions(-)

--
1.7.12.4


2019-09-04 03:06:05

by zhong jiang

[permalink] [raw]
Subject: [PATCH 3/3] Staging: rtl8723bs: Use kzfree rather than its implementation

Use kzfree instead of memset() + kfree().

Signed-off-by: zhong jiang <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_security.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 979056c..57cfe06 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -2290,8 +2290,7 @@ static void gf_mulx(u8 *pad)

static void aes_encrypt_deinit(void *ctx)
{
- memset(ctx, 0, AES_PRIV_SIZE);
- kfree(ctx);
+ kzfree(ctx);
}


--
1.7.12.4