OSDN Git Service

s390/zcrypt: use kvmalloc_array() instead of kzalloc()
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 21 Jun 2023 08:31:23 +0000 (10:31 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 28 Jun 2023 11:57:09 +0000 (13:57 +0200)
commit13cf06d57fa8d2313d53ac19fbc8f1f7c751a4c4
treed07749fd59ad2240dceda46cde58613a0c18fe08
parent0dd0bbc2003a33a0e4705f8eec6ba6535b1e49d1
s390/zcrypt: use kvmalloc_array() instead of kzalloc()

zcrypt_unlocked_ioctl() allocates 256k with kzalloc() which is likely to
fail if memory is fragmented. To avoid that use kvmalloc_array() instead,
like it is done at several other places for the same reason.

Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
drivers/s390/crypto/zcrypt_api.c