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>
This commit is contained in:
Родитель
ecc28f58e6
Коммит
79d6c50227
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче