Skip to content

Commit 2eb0f75

Browse files
Lotte-Bairtg-canonical
authored andcommitted
cifs: Use kzalloc instead of kmalloc/memset
BugLink: https://bugs.launchpad.net/bugs/2036450 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>
1 parent 2d6d243 commit 2eb0f75

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
@@ -464,13 +464,12 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
464464
return -EIO;
465465
}
466466

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

471471
memset(&cur_rqst[0], 0, sizeof(cur_rqst));
472472
memset(&iov, 0, sizeof(iov));
473-
memset(tr_hdr, 0, sizeof(*tr_hdr));
474473

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

0 commit comments

Comments
 (0)