On Tue, 28 Oct 2025, Miaoqian Lin wrote:
driver_find_device_by_of_node() calls driver_find_device(), which calls get_device(). get_device() increments the device's reference count, so driver_find_device_by_of_node() returns a device with its reference count incremented. We need to release this reference after usage to avoid a reference leak.
Add put_device(dev) after dev_get_drvdata() to fix the reference leak.
Found via static analysis.
Fixes: f36e789a1f8d ("mfd: altera-sysmgr: Add SOCFPGA System Manager") Cc: stable@vger.kernel.org Signed-off-by: Miaoqian Lin linmq006@gmail.com
Looks like Johan beat you to it.