The original patch was basically fine.
I propose to reconsider the interpretation of the software situation once more.
* Should the allocated clock object be kept usable even after a successful return from this function?
* How much do “destructor” calls matter here for (sub)devices?
Just add a Fixes tag and resend.
This tag can help also.
Regards, Markus