put_device() is only called on the error path, causing a reference leak on the success path. Fix this by calling put_device() once pdev is no longer needed.
How do you think about to increase the application of scope-based resource management? https://elixir.bootlin.com/linux/v6.17-rc6/source/include/linux/device.h#L11... https://elixir.bootlin.com/linux/v6.17-rc6/source/include/linux/of.h#L138
Regards, Markus