Commit 0bb6bba5 authored by Vasyl Gomonovych's avatar Vasyl Gomonovych Committed by Martin Schwidefsky

s390/pkey: fix kzalloc-simple.cocci warnings

drivers/s390/crypto/pkey_api.c:128:11-18: WARNING:
kzalloc should be used for cprbmem, instead of kmalloc/memset

Use kzalloc rather than kmalloc followed by memset with 0
Signed-off-by: default avatarVasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent df8bbd0c
...@@ -125,10 +125,9 @@ static int alloc_and_prep_cprbmem(size_t paramblen, ...@@ -125,10 +125,9 @@ static int alloc_and_prep_cprbmem(size_t paramblen,
* allocate consecutive memory for request CPRB, request param * allocate consecutive memory for request CPRB, request param
* block, reply CPRB and reply param block * block, reply CPRB and reply param block
*/ */
cprbmem = kmalloc(2 * cprbplusparamblen, GFP_KERNEL); cprbmem = kzalloc(2 * cprbplusparamblen, GFP_KERNEL);
if (!cprbmem) if (!cprbmem)
return -ENOMEM; return -ENOMEM;
memset(cprbmem, 0, 2 * cprbplusparamblen);
preqcblk = (struct CPRBX *) cprbmem; preqcblk = (struct CPRBX *) cprbmem;
prepcblk = (struct CPRBX *) (cprbmem + cprbplusparamblen); prepcblk = (struct CPRBX *) (cprbmem + cprbplusparamblen);
......
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