mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
ptp: ocp: fix dpll cleanup on probe error
Two problems on the dpll error paths in ptp_ocp_probe(). dpll_device_register() takes a second reference and stores bp as the registration private data, and only dpll_device_unregister() drops it. out_dpll dropped bp->tracker but never unregistered, so a dpll_pin_get() or dpll_pin_register() failure left the device registered and visible to userspace with a priv pointer into the storage devlink_free() releases a few lines later, as well as leaking the registration object. A failing dpll_device_register() jumped to the same label as the failing dpll_device_get(), so the reference taken by dpll_device_get() was never dropped either. Give that case its own label. Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path Signed-off-by: Sagi Maimon <maimon.sagi@gmail.com> Link: https://patch.msgid.link/20260916153242.157171-3-sagi.maimon@adtran.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a2bd6c1766
commit
65ca1f70c4
1 changed files with 7 additions and 1 deletions
Loading…
Add table
Add a link
Reference in a new issue