Skip to content

Commit 81a94b2

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: use kvzalloc instead of kvmalloc
Use kvzalloc instead of kvmalloc. Reported-by: kernel test robot <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent ccb5889 commit 81a94b2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work)
543543
if (le32_to_cpu(hdr->NextCommand) > 0)
544544
sz = large_sz;
545545

546-
work->response_buf = kvmalloc(sz, GFP_KERNEL | __GFP_ZERO);
546+
work->response_buf = kvzalloc(sz, GFP_KERNEL);
547547
if (!work->response_buf)
548548
return -ENOMEM;
549549

@@ -6094,7 +6094,7 @@ static noinline int smb2_read_pipe(struct ksmbd_work *work)
60946094
}
60956095

60966096
work->aux_payload_buf =
6097-
kvmalloc(rpc_resp->payload_sz, GFP_KERNEL | __GFP_ZERO);
6097+
kvmalloc(rpc_resp->payload_sz, GFP_KERNEL);
60986098
if (!work->aux_payload_buf) {
60996099
err = -ENOMEM;
61006100
goto out;
@@ -6246,7 +6246,7 @@ int smb2_read(struct ksmbd_work *work)
62466246
ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
62476247
fp->filp, offset, length);
62486248

6249-
work->aux_payload_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO);
6249+
work->aux_payload_buf = kvzalloc(length, GFP_KERNEL);
62506250
if (!work->aux_payload_buf) {
62516251
err = -ENOMEM;
62526252
goto out;
@@ -6395,7 +6395,7 @@ static ssize_t smb2_write_rdma_channel(struct ksmbd_work *work,
63956395
int ret;
63966396
ssize_t nbytes;
63976397

6398-
data_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO);
6398+
data_buf = kvzalloc(length, GFP_KERNEL);
63996399
if (!data_buf)
64006400
return -ENOMEM;
64016401

fs/smb/server/transport_ipc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static struct ksmbd_ipc_msg *ipc_msg_alloc(size_t sz)
229229
struct ksmbd_ipc_msg *msg;
230230
size_t msg_sz = sz + sizeof(struct ksmbd_ipc_msg);
231231

232-
msg = kvmalloc(msg_sz, GFP_KERNEL | __GFP_ZERO);
232+
msg = kvzalloc(msg_sz, GFP_KERNEL);
233233
if (msg)
234234
msg->sz = sz;
235235
return msg;
@@ -268,7 +268,7 @@ static int handle_response(int type, void *payload, size_t sz)
268268
entry->type + 1, type);
269269
}
270270

271-
entry->response = kvmalloc(sz, GFP_KERNEL | __GFP_ZERO);
271+
entry->response = kvzalloc(sz, GFP_KERNEL);
272272
if (!entry->response) {
273273
ret = -ENOMEM;
274274
break;

fs/smb/server/vfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
436436
}
437437

438438
if (v_len < size) {
439-
wbuf = kvmalloc(size, GFP_KERNEL | __GFP_ZERO);
439+
wbuf = kvzalloc(size, GFP_KERNEL);
440440
if (!wbuf) {
441441
err = -ENOMEM;
442442
goto out;
@@ -853,7 +853,7 @@ ssize_t ksmbd_vfs_listxattr(struct dentry *dentry, char **list)
853853
if (size <= 0)
854854
return size;
855855

856-
vlist = kvmalloc(size, GFP_KERNEL | __GFP_ZERO);
856+
vlist = kvzalloc(size, GFP_KERNEL);
857857
if (!vlist)
858858
return -ENOMEM;
859859

0 commit comments

Comments
 (0)