From: Jens Axboe <[email protected]>
To: [email protected]
Cc: [email protected], [email protected],
[email protected],
Minghao Chi <[email protected]>,
Zeal Robot <[email protected]>
Subject: Re: [PATCH] io_uring: Remove redundant NULL check before kfree
Date: Thu, 2 Jun 2022 01:47:38 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 6/2/22 1:18 AM, [email protected] 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 [PATCH] io_uring: Remove redundant NULL check before kfree 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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