From: Jens Axboe <axboe@kernel.dk>
To: cgel.zte@gmail.com
Cc: asml.silence@gmail.com, io-uring@vger.kernel.org,
linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] io_uring: Remove redundant NULL check before kfree
Date: Thu, 2 Jun 2022 01:47:38 -0600 [thread overview]
Message-ID: <1647636f-007e-2912-c2d9-7fed172ca352@kernel.dk> (raw)
In-Reply-To: <20220602071841.278214-1-chi.minghao@zte.com.cn>
On 6/2/22 1:18 AM, cgel.zte@gmail.com wrote:
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 1fc0166d9133..d1fe967f2343 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -4445,8 +4445,7 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
> kiocb_done(req, ret, issue_flags);
> out_free:
> /* it's faster to check here then delegate to kfree */
> - if (iovec)
> - kfree(iovec);
> + kfree(iovec);
> return 0;
> }
There is _literally_ a comment right above your change that explains why
this is there. Please read surrounding code, at least.
--
Jens Axboe
prev parent reply other threads:[~2022-06-02 7:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-02 7:18 cgel.zte
2022-06-02 7:47 ` Jens Axboe [this message]
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=1647636f-007e-2912-c2d9-7fed172ca352@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zealci@zte.com.cn \
/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
all inboxes | Powered by JetHome®