From: Namjae Jeon namjae.jeon@samsung.com
mainline inclusion from mainline-5.15-rc1 commit 12fc704441ad86a0a29e60708490109954f097fa category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA
Reference: https://git.kernel.org/torvalds/linux/c/12fc704441ad
-------------------------------
Call kzalloc() directly instead of wrapper function.
Reviewed-by: Dan Carpenter dan.carpenter@oracle.com Signed-off-by: Namjae Jeon namjae.jeon@samsung.com Signed-off-by: Steve French stfrench@microsoft.com Signed-off-by: Jason Yan yanaijie@huawei.com Signed-off-by: Zhong Jinghua zhongjinghua@huawei.com --- fs/cifsd/crypto_ctx.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/cifsd/crypto_ctx.c b/fs/cifsd/crypto_ctx.c index dbfe36ee9be1..9685bf963702 100644 --- a/fs/cifsd/crypto_ctx.c +++ b/fs/cifsd/crypto_ctx.c @@ -104,11 +104,6 @@ static struct shash_desc *alloc_shash_desc(int id) return shash; }
-static struct ksmbd_crypto_ctx *ctx_alloc(void) -{ - return kzalloc(sizeof(struct ksmbd_crypto_ctx), GFP_KERNEL); -} - static void ctx_free(struct ksmbd_crypto_ctx *ctx) { int i; @@ -145,7 +140,7 @@ static struct ksmbd_crypto_ctx *ksmbd_find_crypto_ctx(void) ctx_list.avail_ctx++; spin_unlock(&ctx_list.ctx_lock);
- ctx = ctx_alloc(); + ctx = kzalloc(sizeof(struct ksmbd_crypto_ctx), GFP_KERNEL); if (!ctx) { spin_lock(&ctx_list.ctx_lock); ctx_list.avail_ctx--; @@ -280,7 +275,7 @@ int ksmbd_crypto_create(void) init_waitqueue_head(&ctx_list.ctx_wait); ctx_list.avail_ctx = 1;
- ctx = ctx_alloc(); + ctx = kzalloc(sizeof(struct ksmbd_crypto_ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; list_add(&ctx->list, &ctx_list.idle_ctx);