Thread (10 messages) 10 messages, 4 authors, 19d ago

RE: [Intel-wired-lan] [PATCH net v2 2/2] ice: dpll: fix memory leak in ice_dpll_init_info error paths

From: Rinitha, SX <hidden>
Date: 2026-06-18 05:52:54
Also in: intel-wired-lan, lkml

-----Original Message-----
From: Intel-wired-lan <redacted> On Behalf Of ZhaoJinming
Sent: 29 May 2026 11:08
To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>; David S . Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>
Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; ZhaoJinming <redacted>
Subject: [Intel-wired-lan] [PATCH net v2 2/2] ice: dpll: fix memory leak in ice_dpll_init_info error paths

Several error return paths in ice_dpll_init_info() directly return without freeing previously allocated resources, causing memory leaks:

- When de->input_prio allocation fails, d->inputs is leaked
- When dp->input_prio allocation fails, d->inputs and de->input_prio
 are leaked
- When ice_get_cgu_rclk_pin_info() fails, all previously allocated
 inputs/outputs/input_prio are leaked
- When ice_dpll_init_pins_info(RCLK_INPUT) fails, same resources
 are leaked

Fix this by jumping to the deinit_info label which properly calls
ice_dpll_deinit_info() to free all allocated resources.

Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu")
Signed-off-by: ZhaoJinming <redacted>
---
drivers/net/ethernet/intel/ice/ice_dpll.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
Tested-by: Rinitha S <redacted> (A Contingent worker at Intel)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help