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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);