[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1650277586-31431-1-git-send-email-baihaowen@meizu.com>
Date: Mon, 18 Apr 2022 18:26:26 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: Steve French <sfrench@...ba.org>
CC: Haowen Bai <baihaowen@...zu.com>, <linux-cifs@...r.kernel.org>,
<samba-technical@...ts.samba.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] 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: Haowen Bai <baihaowen@...zu.com>
---
fs/cifs/transport.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index d9d1c353bafc..c667e6ddfe2f 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -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);
--
2.7.4
Powered by blists - more mailing lists