[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jzoek4r7.fsf@mailhost.krisman.be>
Date: Fri, 12 Jan 2024 11:25:48 -0300
From: Gabriel Krisman Bertazi <krisman@...e.de>
To: Markus Elfring <Markus.Elfring@....de>
Cc: io-uring@...r.kernel.org, kernel-janitors@...r.kernel.org, Jens Axboe
<axboe@...nel.dk>, Pavel Begunkov <asml.silence@...il.com>, LKML
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] io_uring: Delete a redundant kfree() call in
io_ring_ctx_alloc()
Markus Elfring <Markus.Elfring@....de> writes:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Wed, 10 Jan 2024 20:54:43 +0100
>
> Another useful pointer was not reassigned to the data structure member
> “io_bl” by this function implementation.
> Thus omit a redundant call of the function “kfree” at the end.
Perhaps rewrite this to:
ctx->io_bl is initialized later through IORING_OP_PROVIDE_BUFFERS or
IORING_REGISTER_PBUF_RING later on, so there is nothing to free in the
ctx allocation error path.
Other than that, and for this patch only:
Reviewed-by: Gabriel Krisman Bertazi <krisman@...e.de>
thanks,
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>
> v2:
> A change request by Gabriel Krisman Bertazi was applied here.
>
>
> io_uring/io_uring.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index 86761ec623f9..c9a63c39cdd0 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -344,7 +344,6 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
> err:
> kfree(ctx->cancel_table.hbs);
> kfree(ctx->cancel_table_locked.hbs);
> - kfree(ctx->io_bl);
> xa_destroy(&ctx->io_bl_xa);
> kfree(ctx);
> return NULL;
> --
> 2.43.0
>
--
Gabriel Krisman Bertazi
Powered by blists - more mailing lists