Commit 81a94b27 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

ksmbd: use kvzalloc instead of kvmalloc

Use kvzalloc instead of kvmalloc.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent ccb5889a
...@@ -543,7 +543,7 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work) ...@@ -543,7 +543,7 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work)
if (le32_to_cpu(hdr->NextCommand) > 0) if (le32_to_cpu(hdr->NextCommand) > 0)
sz = large_sz; sz = large_sz;
work->response_buf = kvmalloc(sz, GFP_KERNEL | __GFP_ZERO); work->response_buf = kvzalloc(sz, GFP_KERNEL);
if (!work->response_buf) if (!work->response_buf)
return -ENOMEM; return -ENOMEM;
...@@ -6094,7 +6094,7 @@ static noinline int smb2_read_pipe(struct ksmbd_work *work) ...@@ -6094,7 +6094,7 @@ static noinline int smb2_read_pipe(struct ksmbd_work *work)
} }
work->aux_payload_buf = work->aux_payload_buf =
kvmalloc(rpc_resp->payload_sz, GFP_KERNEL | __GFP_ZERO); kvmalloc(rpc_resp->payload_sz, GFP_KERNEL);
if (!work->aux_payload_buf) { if (!work->aux_payload_buf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -6246,7 +6246,7 @@ int smb2_read(struct ksmbd_work *work) ...@@ -6246,7 +6246,7 @@ int smb2_read(struct ksmbd_work *work)
ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n", ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
fp->filp, offset, length); fp->filp, offset, length);
work->aux_payload_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO); work->aux_payload_buf = kvzalloc(length, GFP_KERNEL);
if (!work->aux_payload_buf) { if (!work->aux_payload_buf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -6395,7 +6395,7 @@ static ssize_t smb2_write_rdma_channel(struct ksmbd_work *work, ...@@ -6395,7 +6395,7 @@ static ssize_t smb2_write_rdma_channel(struct ksmbd_work *work,
int ret; int ret;
ssize_t nbytes; ssize_t nbytes;
data_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO); data_buf = kvzalloc(length, GFP_KERNEL);
if (!data_buf) if (!data_buf)
return -ENOMEM; return -ENOMEM;
......
...@@ -229,7 +229,7 @@ static struct ksmbd_ipc_msg *ipc_msg_alloc(size_t sz) ...@@ -229,7 +229,7 @@ static struct ksmbd_ipc_msg *ipc_msg_alloc(size_t sz)
struct ksmbd_ipc_msg *msg; struct ksmbd_ipc_msg *msg;
size_t msg_sz = sz + sizeof(struct ksmbd_ipc_msg); size_t msg_sz = sz + sizeof(struct ksmbd_ipc_msg);
msg = kvmalloc(msg_sz, GFP_KERNEL | __GFP_ZERO); msg = kvzalloc(msg_sz, GFP_KERNEL);
if (msg) if (msg)
msg->sz = sz; msg->sz = sz;
return msg; return msg;
...@@ -268,7 +268,7 @@ static int handle_response(int type, void *payload, size_t sz) ...@@ -268,7 +268,7 @@ static int handle_response(int type, void *payload, size_t sz)
entry->type + 1, type); entry->type + 1, type);
} }
entry->response = kvmalloc(sz, GFP_KERNEL | __GFP_ZERO); entry->response = kvzalloc(sz, GFP_KERNEL);
if (!entry->response) { if (!entry->response) {
ret = -ENOMEM; ret = -ENOMEM;
break; break;
......
...@@ -436,7 +436,7 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos, ...@@ -436,7 +436,7 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
} }
if (v_len < size) { if (v_len < size) {
wbuf = kvmalloc(size, GFP_KERNEL | __GFP_ZERO); wbuf = kvzalloc(size, GFP_KERNEL);
if (!wbuf) { if (!wbuf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -853,7 +853,7 @@ ssize_t ksmbd_vfs_listxattr(struct dentry *dentry, char **list) ...@@ -853,7 +853,7 @@ ssize_t ksmbd_vfs_listxattr(struct dentry *dentry, char **list)
if (size <= 0) if (size <= 0)
return size; return size;
vlist = kvmalloc(size, GFP_KERNEL | __GFP_ZERO); vlist = kvzalloc(size, GFP_KERNEL);
if (!vlist) if (!vlist)
return -ENOMEM; return -ENOMEM;
......
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