Commit 79d6c502 authored by Zou Wei's avatar Zou Wei Committed by Vasily Gorbik

s390/zcrypt: use kzalloc

This patch fixes below warning reported by coccicheck

drivers/s390/crypto/zcrypt_ep11misc.c:198:8-15: WARNING:
kzalloc should be used for cprb, instead of kmalloc/memset

Link: https://lkml.kernel.org/r/1587472548-105240-1-git-send-email-zou_wei@huawei.comReported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent ecc28f58
...@@ -195,11 +195,10 @@ static inline struct ep11_cprb *alloc_cprb(size_t payload_len) ...@@ -195,11 +195,10 @@ static inline struct ep11_cprb *alloc_cprb(size_t payload_len)
size_t len = sizeof(struct ep11_cprb) + payload_len; size_t len = sizeof(struct ep11_cprb) + payload_len;
struct ep11_cprb *cprb; struct ep11_cprb *cprb;
cprb = kmalloc(len, GFP_KERNEL); cprb = kzalloc(len, GFP_KERNEL);
if (!cprb) if (!cprb)
return NULL; return NULL;
memset(cprb, 0, len);
cprb->cprb_len = sizeof(struct ep11_cprb); cprb->cprb_len = sizeof(struct ep11_cprb);
cprb->cprb_ver_id = 0x04; cprb->cprb_ver_id = 0x04;
memcpy(cprb->func_id, "T4", 2); memcpy(cprb->func_id, "T4", 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment