[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <084d0445-b504-4323-b852-81e700f8fbe6@kernel.org>
Date: Sat, 22 Nov 2025 14:03:16 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Ally Heev <allyheev@...il.com>, Madhavan Srinivasan
<maddy@...ux.ibm.com>, Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH v2] powerpc: 82xx: fix uninitialized pointers with free
attribute
On 16/11/2025 15:25, Ally Heev wrote:
> Uninitialized pointers with `__free` attribute can cause undefined
> behavior as the memory allocated to the pointer is freed automatically
> when the pointer goes out of scope.
>
> powerpc/km82xx doesn't have any bugs related to this as of now, but,
> it is better to initialize and assign pointers with `__free` attribute
> in one statement to ensure proper scope-based cleanup
>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/all/aPiG_F5EBQUjZqsl@stanley.mountain/
> Signed-off-by: Ally Heev <allyheev@...il.com>
> ---
> Changes in v2:
> - updated commit description
> - Link to v1: https://lore.kernel.org/r/20251104-aheev-uninitialized-free-attr-km82xx-v1-1-903be69f2cd4@gmail.com
> ---
This is the correct approach and the original patch should have never
been amended while applying.
Reviewed-by: Krzysztof Kozlowski <krzk@...nel.org>
Best regards,
Krzysztof
Powered by blists - more mailing lists