From: Mark Rutland <mark.rutland@arm.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.or
Subject: Re: [PATCH] io_uring: free allocated io_memory once
Date: Tue, 30 Apr 2019 17:26:26 +0100 [thread overview]
Message-ID: <20190430162626.GC8314@lakrids.cambridge.arm.com> (raw)
In-Reply-To: <89bc35e4-ae74-a15f-03fd-9f766c86315a@kernel.dk>
On Tue, Apr 30, 2019 at 10:22:23AM -0600, Jens Axboe wrote:
> On 4/30/19 10:20 AM, Mark Rutland wrote:
> > - io_mem_free(ctx->sq_ring);
> > - io_mem_free(ctx->sq_sqes);
> > - io_mem_free(ctx->cq_ring);
> > + if (ctx->sq_ring)
> > + io_mem_free(ctx->sq_ring);
> > + if (ctx->sq_sqes)
> > + io_mem_free(ctx->sq_sqes);
> > + if (ctx->cq_ring)
> > + io_mem_free(ctx->cq_ring);
>
> Please just make io_mem_free() handle a NULL pointer so we don't need
> these checks.
Sure; I'll spin a v2 momentarily.
Thanks,
Mark.
prev parent reply other threads:[~2019-04-30 16:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-30 16:20 Mark Rutland
2019-04-30 16:22 ` Jens Axboe
2019-04-30 16:26 ` Mark Rutland [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=20190430162626.GC8314@lakrids.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.or \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®