> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Ally Heev
> Sent: Thursday, November 6, 2025 11:09 AM
> To: Nguyen, Anthony L <[email protected]>; Kitszel,
> Przemyslaw <[email protected]>; Andrew Lunn
> <[email protected]>; David S. Miller <[email protected]>; Eric
> Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo
> Abeni <[email protected]>; K. Y. Srinivasan <[email protected]>;
> Haiyang Zhang <[email protected]>; Wei Liu <[email protected]>;
> Cui, Dexuan <[email protected]>
> Cc: [email protected]; [email protected]; linux-
> [email protected]; [email protected]; Dan Carpenter
> <[email protected]>; Ally Heev <[email protected]>
> Subject: [Intel-wired-lan] [PATCH v2] net: ethernet: fix uninitialized
> pointers with free attr
> 
> Uninitialized pointers with `__free` attribute can cause undefined
> behaviour as the memory assigned(randomly) to the pointer is freed
> automatically when the pointer goes out of scope
> 
> net/ethernet doesn't have any bugs related to this as of now, but it
> is better to initialize and assign pointers with `__free` attr in one
> statement to ensure proper scope-based cleanup
> 
> Reported-by: Dan Carpenter <[email protected]>
> Closes: https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Ally Heev <[email protected]>
> ---
> Changes in v2:
> - fixed non pointer initialization to NULL
> - NOTE: drop v1
> - Link to v1: https://lore.kernel.org/r/20251105-aheev-uninitialized-
> [email protected]
> ---
...

> Best regards,
> --
> Ally Heev <[email protected]>

Good day, Ally

Thanks for addressing the cleanup attribute initialization.
A few upstream‑style nits before this can go in:

Commit message:
  Use US spelling: behavior instead of behaviour.
  Expand abbreviations: replace attr with attribute.
  Drop speculative sentence: “net/ethernet doesn't have any bugs …” – not 
needed for a fix commit.
  Minor grammar: add a period before “net/ethernet”; remove parentheses in 
assigned(randomly).

Changelog:
  Hyphenate “non‑pointer” in “fixed non pointer initialization to NULL”.

Subject line:
net: ethernet: fix uninitialized pointers with __free attribute (spell out 
“attribute”).


Code style:
The new declaration + initializer is good, but please ensure both hunks stay 
within ~80 columns in drivers/net/*.
Wrapping like this is fine:

struct ice_flow_prof_params *params __free(kfree) =
        kzalloc(sizeof(*params), GFP_KERNEL);

No functional issues found; just these style and commit message cleanups.

Thanks,
Alex

Reply via email to