From: Jacob Keller <jacob.e.keller@intel.com>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>,
"Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Oros, Petr" <poros@redhat.com>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>,
Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH iwl-net 6/6] ice: register LAG event handler last in ice_init_lag()
Date: Thu, 5 Nov 2026 10:42:48 -0800 [thread overview]
Message-ID: <15958f48-e342-4563-903d-db044c6c0db8@intel.com> (raw)
In-Reply-To: <3a4b6204-fa1d-4052-a5ee-c0c056b0e3de@intel.com>
On 11/3/2026 4:42 AM, Przemek Kitszel wrote:
> On 11/3/26 12:23 PM, Loktionov, Aleksandr wrote:
>>
>>
>>> -----Original Message-----
>>> From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>>> Sent: Monday, November 2, 2026 11:50 AM
>>> To: intel-wired-lan@lists.osuosl.org; Oros, Petr <poros@redhat.com>
>>> Cc: netdev@vger.kernel.org; Kitszel, Przemyslaw
>>> <przemyslaw.kitszel@intel.com>; Sashiko <sashiko-bot@kernel.org>
>>> Subject: [PATCH iwl-net 6/6] ice: register LAG event handler last in
>>> ice_init_lag()
>>>
>>> ice_init_lag() registers the netdevice notifier before it creates the
>>> LAG recipes, but when creating any of them fails, the error path frees
>>> the lag struct without unregistering the notifier. A failure of
>>> ice_init_lag() is not fatal to probe, and pf->lag is set to NULL, so
>>> ice_deinit_lag() won't unregister it later either. The next netdev event
>>> then makes
>>> ice_lag_event_handler() use the freed lag struct.
>>>
>>> Register the notifier last, after the recipes are created and associated
>>> with the profiles, so the error paths have no handler, nor queued work
>>> for it, that could use the lag struct or its recipes. Free the recipes
>>> if the registration itself fails.
>>>
>>> Fixes: ec5a6c5f79ed ("ice: process events created by lag netdev event
>>> handler")
>>> Reported-by: Sashiko <sashiko-bot@kernel.org>
>>> Closes: https://sashiko.dev/#/bug/linux-e0559bca-fcfd-4435-96f2-
>>> 15f7e3d74184
>>> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>>> ---
>>> drivers/net/ethernet/intel/ice/ice_lag.c | 15 +++++++++------
>>> 1 file changed, 9 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c
>>> b/drivers/net/ethernet/intel/ice/ice_lag.c
>>> index 08a17ded0ad5..c4b8af01e2af 100644
>>> --- a/drivers/net/ethernet/intel/ice/ice_lag.c
>>> +++ b/drivers/net/ethernet/intel/ice/ice_lag.c
>>> @@ -2601,12 +2601,6 @@ int ice_init_lag(struct ice_pf *pf)
>>> lag->notif_block.notifier_call = NULL;
>>> memset(lag->sec_vf, 0, sizeof(lag->sec_vf));
>>>
>>> - err = ice_register_lag_handler(lag);
>>> - if (err) {
>>> - dev_warn(dev, "INIT LAG: Failed to register event
>>> handler\n");
>>> - goto lag_error;
>>> - }
>>> -
>>> err = ice_create_lag_recipe(&pf->hw, &lag->pf_recipe,
>>> ice_dflt_vsi_rcp, 1);
>> I'm afraid act_act_recipe is allocated but never released on the
>> normal teardown path.
>> See ice_deinit_lag() it has just kfree(lag);
>
> you are right, the code behaves that way both before and after the patch
> FW resets those via PFR at appropriate moment (appropriate to ensure
> correctness, not to have clean code).
>
> Not going to change that as part of little fix.
Yep, that should be cleaned up as a separate from this series. Will
apply this to dev-queue.
next prev parent reply other threads:[~2026-11-05 18:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 10:50 [PATCH iwl-net 0/6] ice: fix DCB lock ordering Przemek Kitszel
2026-11-02 10:49 ` netdev-bot+sinfo
2026-11-02 10:50 ` [PATCH iwl-net 1/6] ice: don't wait out a reset in ice_dcbnl_devreset() Przemek Kitszel
2026-11-02 10:50 ` [PATCH iwl-net 2/6] ice: take rtnl before tc_mutex in DCB MIB change and rebuild Przemek Kitszel
2026-11-02 10:50 ` [PATCH iwl-net 3/6] ice: clear stale rate_node pointers in ice_tear_down_devlink_rate_tree() Przemek Kitszel
2026-11-02 10:50 ` [PATCH iwl-net 4/6] ice: don't block on locks " Przemek Kitszel
2026-11-02 10:50 ` [PATCH iwl-net 5/6] ice: replace tc_mutex with RTNL Przemek Kitszel
2026-11-02 10:50 ` [PATCH iwl-net 6/6] ice: register LAG event handler last in ice_init_lag() Przemek Kitszel
2026-11-03 11:23 ` Loktionov, Aleksandr
2026-11-03 12:42 ` Przemek Kitszel
2026-11-05 18:42 ` Jacob Keller [this message]
2026-11-05 18:46 ` [PATCH iwl-net 0/6] ice: fix DCB lock ordering Jacob Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15958f48-e342-4563-903d-db044c6c0db8@intel.com \
--to=jacob.e.keller@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=netdev@vger.kernel.org \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sashiko-bot@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.