Thread (7 messages) flat view 7 messages, 4 authors, 6d ago

Re: [PATCH RFT net-next 2/2] idpf: remove __free usage in idpf_virtchnl

From: Jeff Johnson <hidden>
Date: 2026-08-04 22:57:02
Also in: intel-wired-lan, lkml

On 8/4/2026 3:54 PM, Jeff Johnson wrote:
On 11/16/2025 7:56 AM, Ally Heev wrote:
quoted
usage of cleanup attributes is discouraged in net [1], achieve cleanup
using goto. In this patch though, only uninitialized pointers with __free
attribute are cleaned as they can cause undefined behavior when they
go out of scope

Suggested-by: Simon Horman <horms@kernel.org>
Reported-by: Dan Carpenter <redacted>
Closes: https://lore.kernel.org/all/aPiG_F5EBQUjZqsl@stanley.mountain/ (local)
Signed-off-by: Ally Heev <redacted>

[1] https://docs.kernel.org/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs
<SMH>

If using __free() *correctly* gives more readable code, why wouldn't we do it?

The only problem with this function is that it doesn't follow the guidance
from cleanup.h:

 * the recommendation is to always define and assign variables in one
 * statement and not group variable definitions at the top of the
 * function when __free() is used.
OMG, not sure why Thunderbird showed this as a recent unread e-mail.
Please ignore this noise!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help