From: Steve French <smfrench@gmail.com>
To: Julia Lawall <Julia.Lawall@inria.fr>
Cc: kernel-janitors <kernel-janitors@vger.kernel.org>,
CIFS <linux-cifs@vger.kernel.org>,
samba-technical <samba-technical@lists.samba.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] cifs: use kzalloc
Date: Mon, 14 Mar 2022 23:15:20 -0500 [thread overview]
Message-ID: <CAH2r5mtD3=BiSDE4pLMpsc708dkP43hXosdyorfENawV9ura9g@mail.gmail.com> (raw)
In-Reply-To: <20220312102705.71413-2-Julia.Lawall@inria.fr>
Which tree should this be merged from? cifs-2.6.git for-next ... or
do you prefer that these all go together through a different tree
On Sun, Mar 13, 2022 at 11:36 AM Julia Lawall <Julia.Lawall@inria.fr> wrote:
>
> Use kzalloc instead of kmalloc + memset.
>
> The semantic patch that makes this change is:
> (https://coccinelle.gitlabpages.inria.fr/website/)
>
> //<smpl>
> @@
> expression res, size, flag;
> @@
> - res = kmalloc(size, flag);
> + res = kzalloc(size, flag);
> ...
> - memset(res, 0, size);
> //</smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
>
> ---
> 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 eeb1a699bd6f..4ff8e165a180 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);
>
--
Thanks,
Steve
next prev parent reply other threads:[~2022-03-15 4:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-12 10:26 [PATCH 0/6] use kzalloc Julia Lawall
2022-03-12 10:27 ` [PATCH 1/6] cifs: " Julia Lawall
2022-03-15 4:15 ` Steve French [this message]
2022-03-12 10:27 ` [PATCH 2/6] net/mlx4_en: " Julia Lawall
2022-03-14 12:37 ` Tariq Toukan
2022-03-12 10:27 ` [PATCH 3/6] ALSA: seq: oss: " Julia Lawall
2022-03-12 21:43 ` Joe Perches
2022-03-13 8:09 ` Takashi Iwai
2022-03-12 10:27 ` [PATCH 4/6] scsi: lpfc: " Julia Lawall
2022-03-12 21:45 ` Joe Perches
2022-03-14 11:34 ` Dan Carpenter
2022-03-14 11:50 ` Julia Lawall
2022-03-12 10:27 ` [PATCH 5/6] zd1201: " Julia Lawall
2022-03-16 15:29 ` Kalle Valo
2022-03-12 10:27 ` [PATCH 6/6] usb: raw-gadget: " Julia Lawall
2022-03-14 20:30 ` [PATCH 0/6] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH2r5mtD3=BiSDE4pLMpsc708dkP43hXosdyorfENawV9ura9g@mail.gmail.com' \
--to=smfrench@gmail.com \
--cc=Julia.Lawall@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).