mirror-linux/drivers/dpll
Ivan Vecera fa997ddef5 dpll: zl3073x: fix memory leak on pin registration failure
If zl3073x_dpll_pin_register() fails, the allocated pin is not yet
added to zldpll->pins list. The error path calls
zl3073x_dpll_pins_unregister() which only iterates pins on the list,
so the current pin is leaked. Free the pin before jumping to the error
label.

Additionally move the pin->dpll_pin = NULL assignment in
zl3073x_dpll_pin_register() from err_register to the common
err_pin_get path. When dpll_pin_get() fails, pin->dpll_pin holds an
ERR_PTR value. Without this fix the subsequent zl3073x_dpll_pin_free()
would trigger a spurious WARN because it checks pin->dpll_pin for
non-NULL.

Fixes: 75a71ecc24 ("dpll: zl3073x: Register DPLL devices and pins")
Reviewed-by: Petr Oros <poros@redhat.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260519132205.161847-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-20 19:02:01 -07:00
..
zl3073x dpll: zl3073x: fix memory leak on pin registration failure 2026-05-20 19:02:01 -07:00
Kconfig dpll: Add reference count tracking support 2026-02-05 15:57:46 +01:00
Makefile dpll: Add basic Microchip ZL3073x support 2025-07-09 19:08:52 -07:00
dpll_core.c dpll: add frequency monitoring callback ops 2026-04-03 16:48:01 -07:00
dpll_core.h dpll: Add reference count tracking support 2026-02-05 15:57:46 +01:00
dpll_netlink.c dpll: export __dpll_pin_change_ntf() for use under dpll_lock 2026-04-30 11:37:39 +02:00
dpll_netlink.h dpll: export __dpll_pin_change_ntf() for use under dpll_lock 2026-04-30 11:37:39 +02:00
dpll_nl.c dpll: add frequency monitoring to netlink spec 2026-04-03 16:48:01 -07:00
dpll_nl.h tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00