summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/python_version.py
diff options
context:
space:
mode:
authorAlexander Sverdlin <alexander.sverdlin@siemens.com>2026-08-28 18:44:39 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-10-29 11:23:57 +0100
commita451b6bb922ede877b141beb09c3d2eb3cc9edfe (patch)
tree3da2fbcc433b0b6b83a12dc4f6f4721a44230295 /tools/lib/python/kdoc/python_version.py
parentf6550426f21ec5293feddb74368be6f4e9eefac1 (diff)
rtc: pcf85063: use devm_of_clk_add_hw_provider() for clkout
pcf85063_clkout_register_clk() registered the OF clock provider with the deprecated of_clk_add_provider() and never removed it, so the provider kept pointing at freed data after unbind, leading to a use-after-free the next time the device-tree clock was resolved. Switch to devm_clk_hw_register() and devm_of_clk_add_hw_provider(): both the clock and its OF provider are managed resources now, and the provider is torn down before the clock on unbind. Register the clock on the parent i2c device instead of the rtc device. devm_of_clk_add_hw_provider() must use the parent, which owns the of_node, and the clkout_hw it points at lives in the driver data allocated on the parent. Tying both to the parent releases them together on unbind, before the driver data is freed, and keeps their teardown ordering guaranteed by a single devres list. Registering the clock on the rtc device instead could defer its unregistration past unbind (e.g. while a /dev/rtcN fd is open), after clkout_hw has already been freed. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com> Link: https://patch.msgid.link/20260828164445.3907839-2-alexander.sverdlin@siemens.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions