mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ptp: ocp: Fix dpll device reference leak in ptp_ocp_probe()
@ 2026-09-17 14:23 Wentao Liang
  2026-09-21 15:40 ` netdev-bot+sashiko
  2026-09-22  1:23 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-09-17 14:23 UTC (permalink / raw)
  To: andrew+netdev
  Cc: arkadiusz.kubalewski, davem, edumazet, jiri, kuba, linux-kernel,
	netdev, pabeni, richardcochran, vadim.fedorenko, Wentao Liang,
	stable

ptp_ocp_probe() takes a reference on the dpll device with
dpll_device_get(), but jumps to the out label without dropping it when
dpll_device_register() fails, so the reference leaks. Put it before
returning.

Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/ptp/ptp_ocp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index beacc2ffb166..dacb941da8e9 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -5106,8 +5106,10 @@ ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	err = dpll_device_register(bp->dpll, DPLL_TYPE_PPS, &dpll_ops, bp);
-	if (err)
+	if (err) {
+		dpll_device_put(bp->dpll, &bp->tracker);
 		goto out;
+	}
 
 	for (i = 0; i < OCP_SMA_NUM; i++) {
 		bp->sma[i].dpll_pin = dpll_pin_get(clkid, i, THIS_MODULE,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-22  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 14:23 [PATCH] ptp: ocp: Fix dpll device reference leak in ptp_ocp_probe() Wentao Liang
2026-09-21 15:40 ` netdev-bot+sashiko
2026-09-22  1:23 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®