Thread (4 messages) 4 messages, 4 authors, 14d ago

Re: [PATCH v2] powerpc: 82xx: fix uninitialized pointers with free attribute

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2025-11-22 13:03:20
Also in: lkml

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 <redacted>
Closes: https://lore.kernel.org/all/aPiG_F5EBQUjZqsl@stanley.mountain/ (local)
Signed-off-by: Ally Heev <redacted>
---
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 (local)
---

This is the correct approach and the original patch should have never
been amended while applying.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help