ptp: ocp: fix bug in unregistering the DPLL subsystem
authorSagi Maimon <maimon.sagi@gmail.com>
Wed, 20 Dec 2023 08:19:14 +0000 (10:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Dec 2023 08:37:23 +0000 (08:37 +0000)
When unregistering the DPLL subsystem the priv pointer is different then
the one used for registration which cause failure in unregistering.

Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_ocp.c

index 4021d3d325f951c8cc5ea1a578559a88f146cbee..e7defce8cf48e8cbdf5ed83cccba94dc5124b772 100644 (file)
@@ -4492,7 +4492,7 @@ ptp_ocp_remove(struct pci_dev *pdev)
        cancel_delayed_work_sync(&bp->sync_work);
        for (i = 0; i < OCP_SMA_NUM; i++) {
                if (bp->sma[i].dpll_pin) {
-                       dpll_pin_unregister(bp->dpll, bp->sma[i].dpll_pin, &dpll_pins_ops, bp);
+                       dpll_pin_unregister(bp->dpll, bp->sma[i].dpll_pin, &dpll_pins_ops, &bp->sma[i]);
                        dpll_pin_put(bp->sma[i].dpll_pin);
                }
        }