[<prev] [next>] [day] [month] [year] [list]
Message-ID: <87v8iz75ck.fsf@linux.ibm.com>
Date: Fri, 17 Mar 2023 10:41:31 -0500
From: Nathan Lynch <nathanl@...ux.ibm.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: cocci@...ia.fr, LKML <linux-kernel@...r.kernel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Paul Moore <paul@...l-moore.com>,
linuxppc-dev@...ts.ozlabs.org, kernel-janitors@...r.kernel.org
Subject: Re: powerpc/pseries: Fix exception handling in
pSeries_reconfig_add_node()
Markus Elfring <Markus.Elfring@....de> writes:
>>> The label “out_err” was used to jump to another pointer check despite of
>>> the detail in the implementation of the function “pSeries_reconfig_add_node”
>>> that it was determined already that the corresponding variable contained
>>> a null pointer (because of a failed function call in two cases).
>>>
>>> 1. Thus return directly after a call of the function “kzalloc” failed.
>>>
>>> 2. Use more appropriate labels instead.
>>>
>>> 3. Delete a redundant check.
>>>
>>> 4. Omit an explicit initialisation for the local variable “err”.
>>>
>>> This issue was detected by using the Coccinelle software.
>> Is there a correctness or safety issue here?
>
> I got the impression that the application of only a single label like “out_err”
> resulted in improvable implementation details.
I don't understand what you're trying to say here. It doesn't seem to
answer my question.
>> The subject uses the word "fix" but the commit message doesn't seem to identify one.
>
> Can you find the proposed adjustments reasonable?
In the absence of a bug fix or an improvement in readability, not
really, sorry. It adds to the function more goto labels and another
return, apparently to avoid checks that are sometimes redundant (but not
incorrect) at the C source code level. An optimizing compiler doesn't
necessarily arrange the generated code in the same way.
>> Can you share how Coccinelle is being invoked and its output?
>
> Please take another look at available information sources.
> https://lore.kernel.org/cocci/f9303bdc-b1a7-be5e-56c6-dfa8232b8b55@web.de/
I wasn't cc'd on this and I'm not subscribed to any lists in the
recipients for that message, so not sure how I would take "another"
look. :-)
Powered by blists - more mailing lists