[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DS4PPF7551E6552E6053CC02144D0987191E5C2A@DS4PPF7551E6552.namprd11.prod.outlook.com>
Date: Thu, 6 Nov 2025 10:18:49 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Ally Heev <allyheev@...il.com>, "Nguyen, Anthony L"
<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
<przemyslaw.kitszel@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Jakub
Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "K. Y.
Srinivasan" <kys@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>, "Wei
Liu" <wei.liu@...nel.org>, "Cui, Dexuan" <decui@...rosoft.com>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>, Dan Carpenter
<dan.carpenter@...aro.org>
Subject: RE: [Intel-wired-lan] [PATCH v2] net: ethernet: fix uninitialized
pointers with free attr
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> Of Ally Heev
> Sent: Thursday, November 6, 2025 11:09 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@...el.com>; Andrew Lunn
> <andrew+netdev@...n.ch>; David S. Miller <davem@...emloft.net>; Eric
> Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo
> Abeni <pabeni@...hat.com>; K. Y. Srinivasan <kys@...rosoft.com>;
> Haiyang Zhang <haiyangz@...rosoft.com>; Wei Liu <wei.liu@...nel.org>;
> Cui, Dexuan <decui@...rosoft.com>
> Cc: intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; linux-hyperv@...r.kernel.org; Dan Carpenter
> <dan.carpenter@...aro.org>; Ally Heev <allyheev@...il.com>
> 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 <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:
> - fixed non pointer initialization to NULL
> - NOTE: drop v1
> - Link to v1: https://lore.kernel.org/r/20251105-aheev-uninitialized-
> free-attr-net-ethernet-v1-1-f6ea84bbd750@...il.com
> ---
...
> Best regards,
> --
> Ally Heev <allyheev@...il.com>
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
Powered by blists - more mailing lists