Commit 9339faac authored by Haowen Bai's avatar Haowen Bai Committed by Steve French

cifs: Use kzalloc instead of kmalloc/memset

Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.
Signed-off-by: default avatarHaowen Bai <baihaowen@meizu.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent b2d229d4
......@@ -464,13 +464,12 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
return -EIO;
}
tr_hdr = kmalloc(sizeof(*tr_hdr), GFP_NOFS);
tr_hdr = kzalloc(sizeof(*tr_hdr), GFP_NOFS);
if (!tr_hdr)
return -ENOMEM;
memset(&cur_rqst[0], 0, sizeof(cur_rqst));
memset(&iov, 0, sizeof(iov));
memset(tr_hdr, 0, sizeof(*tr_hdr));
iov.iov_base = tr_hdr;
iov.iov_len = sizeof(*tr_hdr);
......
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