public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/zcrypt: use kzalloc instead of kmalloc/memset
@ 2024-09-25 10:30 Rohit Chavan
  0 siblings, 0 replies; only message in thread
From: Rohit Chavan @ 2024-09-25 10:30 UTC (permalink / raw)
  To: Harald Freudenberger, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, linux-s390, linux-kernel
  Cc: Rohit Chavan

This patch addresses below issue,
WARNING: kzalloc should be used for cprb, instead of kmalloc/memset

Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
---
 drivers/s390/crypto/zcrypt_ep11misc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_ep11misc.c b/drivers/s390/crypto/zcrypt_ep11misc.c
index 004ce022fc78..3c3d403abe92 100644
--- a/drivers/s390/crypto/zcrypt_ep11misc.c
+++ b/drivers/s390/crypto/zcrypt_ep11misc.c
@@ -195,11 +195,10 @@ static inline struct ep11_cprb *alloc_cprb(size_t payload_len)
 	size_t len = sizeof(struct ep11_cprb) + payload_len;
 	struct ep11_cprb *cprb;
 
-	cprb = kmalloc(len, GFP_KERNEL);
+	cprb = kzalloc(len, GFP_KERNEL);
 	if (!cprb)
 		return NULL;
 
-	memset(cprb, 0, len);
 	cprb->cprb_len = sizeof(struct ep11_cprb);
 	cprb->cprb_ver_id = 0x04;
 	memcpy(cprb->func_id, "T4", 2);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-25 10:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25 10:30 [PATCH] s390/zcrypt: use kzalloc instead of kmalloc/memset Rohit Chavan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox