]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dpll: emit per-dpll delete notifications in dpll_pin_on_pin_unregister()
authorGrzegorz Nitka <grzegorz.nitka@intel.com>
Sun, 7 Jun 2026 18:30:37 +0000 (20:30 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 20:24:33 +0000 (13:24 -0700)
dpll_pin_on_pin_register() emits a creation notification for every
parent->dpll_refs entry, but dpll_pin_on_pin_unregister() emitted only
one deletion notification outside the loop. When a pin is registered
against multiple parent dplls, userspace sees N creates but a single
delete and leaks per-dpll state.

Move dpll_pin_delete_ntf() into the loop and call it before
__dpll_pin_unregister() so the DPLL_REGISTERED mark is still set when
dpll_pin_available() is consulted.

Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Link: https://patch.msgid.link/20260607183045.1213735-6-grzegorz.nitka@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/dpll_core.c

index 80195f3a84f3800cc7aeb39dc259c05218923c44..58034be07080a2d2b6b33b594814e8520219cd37 100644 (file)
@@ -1036,14 +1036,14 @@ void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *pin,
        unsigned long i;
 
        mutex_lock(&dpll_lock);
-       dpll_pin_delete_ntf(pin);
-       dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin);
        xa_for_each(&pin->dpll_refs, i, ref) {
                reg = dpll_pin_registration_find(ref, ops, priv, parent);
                if (!reg)
                        continue;
+               dpll_pin_delete_ntf(pin);
                __dpll_pin_unregister(ref->dpll, pin, ops, priv, parent);
        }
+       dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin);
        mutex_unlock(&dpll_lock);
 }
 EXPORT_SYMBOL_GPL(dpll_pin_on_pin_unregister);