]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dpll: fix dpll_xa_ref_*_del() for multiple registrations
authorJiri Pirko <jiri@nvidia.com>
Wed, 6 Mar 2024 15:12:40 +0000 (16:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Mar 2024 11:17:30 +0000 (11:17 +0000)
commitb446631f355ece73b13c311dd712c47381a23172
tree6f25ca231c3f857be68e6eb36060210c1e84c3ac
parent4469c0c5b14a0919f5965c7ceac96b523eb57b79
dpll: fix dpll_xa_ref_*_del() for multiple registrations

Currently, if there are multiple registrations of the same pin on the
same dpll device, following warnings are observed:
WARNING: CPU: 5 PID: 2212 at drivers/dpll/dpll_core.c:143 dpll_xa_ref_pin_del.isra.0+0x21e/0x230
WARNING: CPU: 5 PID: 2212 at drivers/dpll/dpll_core.c:223 __dpll_pin_unregister+0x2b3/0x2c0

The problem is, that in both dpll_xa_ref_dpll_del() and
dpll_xa_ref_pin_del() registration is only removed from list in case the
reference count drops to zero. That is wrong, the registration has to
be removed always.

To fix this, remove the registration from the list and free
it unconditionally, instead of doing it only when the ref reference
counter reaches zero.

Fixes: 9431063ad323 ("dpll: core: Add DPLL framework base functions")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/dpll/dpll_core.c