Skip to content

Commit dae9081

Browse files
Lotte-Bairtg-canonical
authored andcommitted
cifs: Use kzalloc instead of kmalloc/memset
BugLink: https://bugs.launchpad.net/bugs/1970977 Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai <baihaowen@meizu.com> Signed-off-by: Steve French <stfrench@microsoft.com> (cherry picked from commit 9339faa) Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Acked-by: Philip Cox <philip.cox@canonical.com> Acked-by: Joseph Salisbury <joseph.salisbury@canonical.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
1 parent 75bbd36 commit dae9081

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/cifs/transport.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,12 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
465465
return -EIO;
466466
}
467467

468-
tr_hdr = kmalloc(sizeof(*tr_hdr), GFP_NOFS);
468+
tr_hdr = kzalloc(sizeof(*tr_hdr), GFP_NOFS);
469469
if (!tr_hdr)
470470
return -ENOMEM;
471471

472472
memset(&cur_rqst[0], 0, sizeof(cur_rqst));
473473
memset(&iov, 0, sizeof(iov));
474-
memset(tr_hdr, 0, sizeof(*tr_hdr));
475474

476475
iov.iov_base = tr_hdr;
477476
iov.iov_len = sizeof(*tr_hdr);

0 commit comments

Comments
 (0)