Hi,
Andy Shevchenko andriy.shevchenko@linux.intel.com 于2025年9月2日周二 17:37写道:
On Tue, Sep 02, 2025 at 05:03:58PM +0800, Miaoqian Lin wrote:
The reference taken by of_find_device_by_node() must be released when not needed anymore. Add missing put_device() call to fix device reference leaks.
How is this being found? Do you have a stacktrace or kmemleak reports?
This was found through static code analysis. The of_find_device_by_node() documentation states that it "takes a reference to the embedded struct device which needs to be dropped after use."
I cross-referenced other of_find_device_by_node() usage patterns to check the correct usage, then audited this code and found the problem.
I don't have a stacktrace or kmemleak reports.
-- With Best Regards, Andy Shevchenko