summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZou Wei <zou_wei@huawei.com>2020-04-21 20:35:48 +0800
committerVasily Gorbik <gor@linux.ibm.com>2020-06-16 13:44:04 +0200
commit79d6c50227103a9f7df9690b38ff74127f69d3cf (patch)
tree31e4e4fd12038e8dedde8d53f7375d3f516ac0e1 /drivers
parentecc28f58e6cc479253bbd9aced013d8d34fef896 (diff)
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.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/crypto/zcrypt_ep11misc.c3
1 files changed, 1 insertions, 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);