[PATCH] perf: arm_cspmu: fix error handling in arm_cspmu_impl_unregister()
Markus Elfring
Markus.Elfring at web.de
Sat Sep 27 01:28:33 PDT 2025
> driver_find_device() calls get_device() to increment the reference
> count once a matching device is found. device_release_driver()
> releases the driver, but it does not decrease the reference count that
> was incremented by driver_find_device(). At the end of the loop, there
> is no put_device() to balance the reference count. To avoid reference
> count leakage, add put_device() to decrease the reference count.
Can a summary phrase like “Prevent reference count leaks in arm_cspmu_impl_unregister()”
be more appropriate?
Regards,
Markus
More information about the linux-arm-kernel
mailing list