[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87frz2k4jm.fsf@mailhost.krisman.be>
Date: Fri, 12 Jan 2024 11:30:21 -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 2/2] io_uring: Improve exception handling in
io_ring_ctx_alloc()
Markus Elfring <Markus.Elfring@....de> writes:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Wed, 10 Jan 2024 21:15:48 +0100
>
> The label “err” was used to jump to a kfree() call despite of
> the detail in the implementation of the function “io_ring_ctx_alloc”
> that it was determined already that a corresponding variable contained
> a null pointer because of a failed memory allocation.
>
> 1. Thus use more appropriate labels instead.
>
> 2. Reorder jump targets at the end.
>
As I mentioned on v1, this doesn't do us any good, as kfree can handle
NULL pointers just fine, and changes like this becomes churn later when
backporting or modifying the code.
--
Gabriel Krisman Bertazi
Powered by blists - more mailing lists