diff options
author | Vasyl Gomonovych <gomonovych@gmail.com> | 2017-10-11 21:52:46 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-10-16 08:19:23 +0200 |
commit | 0bb6bba5fb426165aa2720e359107ef7c1d90f70 (patch) | |
tree | ea56a67f175a5a996f9ac0d276db48664feab549 /drivers/s390 | |
parent | df8bbd0c98bef5bcf691709437c4102e9840b0f5 (diff) | |
download | talos-op-linux-0bb6bba5fb426165aa2720e359107ef7c1d90f70.tar.gz talos-op-linux-0bb6bba5fb426165aa2720e359107ef7c1d90f70.zip |
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: Vasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/crypto/pkey_api.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c index f61fa47135a6..8dda5bb34a2f 100644 --- a/drivers/s390/crypto/pkey_api.c +++ b/drivers/s390/crypto/pkey_api.c @@ -125,10 +125,9 @@ static int alloc_and_prep_cprbmem(size_t paramblen, * allocate consecutive memory for request CPRB, request param * block, reply CPRB and reply param block */ - cprbmem = kmalloc(2 * cprbplusparamblen, GFP_KERNEL); + cprbmem = kzalloc(2 * cprbplusparamblen, GFP_KERNEL); if (!cprbmem) return -ENOMEM; - memset(cprbmem, 0, 2 * cprbplusparamblen); preqcblk = (struct CPRBX *) cprbmem; prepcblk = (struct CPRBX *) (cprbmem + cprbplusparamblen); |