linux/drivers/net/pcs
Coia Prant 9892d71cf0 net: pcs: xpcs: fix clock reference leak on xpcs_init_clks failure
xpcs_init_clks() takes references with clk_bulk_get_optional() and then
enables them with clk_bulk_prepare_enable(). If the enable step fails,
the function returns without dropping the references.

xpcs_create() handles the failure through out_free_data, which calls
xpcs_free_data() but never xpcs_clear_clks(), so the clk references are
leaked.

Add the missing clk_bulk_put() on the enable failure path. The
prepare/enable side is already rolled back by
clk_bulk_prepare_enable() itself.

Fixes: f6bb3e9d98 ("net: pcs: xpcs: Add Synopsys DW xPCS platform device driver")
Signed-off-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260919172021.2336748-1-coiaprant@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-22 15:39:06 +02:00
..
Kconfig net: pcs: pcs-mtk-lynxi: deprecate "mediatek,pnswap" 2026-01-21 19:46:59 -08:00
Makefile net: pcs: xpcs: Add Synopsys DW xPCS platform device driver 2024-07-05 09:35:50 +01:00
pcs-lynx.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pcs-mtk-lynxi.c net: pcs: mtk-lynxi: check regmap reads in mtk_pcs_lynxi_get_state() 2026-08-07 16:38:46 -07:00
pcs-rzn1-miic.c net: pcs: rzn1-miic: Fix config array initialization 2026-09-17 17:07:43 -07:00
pcs-xpcs-nxp.c net: pcs: xpcs: add _modify() accessors 2024-10-09 12:13:11 +01:00
pcs-xpcs-plat.c driver core: Replace dev->of_node_reused with dev_of_node_reused() 2026-04-26 23:50:20 +02:00
pcs-xpcs-wx.c net: pcs: xpcs: add _modify() accessors 2024-10-09 12:13:11 +01:00
pcs-xpcs.c net: pcs: xpcs: fix clock reference leak on xpcs_init_clks failure 2026-09-22 15:39:06 +02:00
pcs-xpcs.h net: xpcs: rearrange register definitions 2025-02-17 15:37:27 -08:00