Skip to content

Commit

Permalink
cifsd: call kzalloc() directly instead of wrapper
Browse files Browse the repository at this point in the history
Call kzalloc() directly instead of wrapper function.

Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
namjaejeon committed May 26, 2021
1 parent 533a45d commit 12fc704
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions fs/cifsd/crypto_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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--;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 12fc704

Please sign in to comment.