perf/arm_cspmu: fix device leaks on module unload
Subsystems (2)
PATCH 1/1 perf/arm_cspmu: fix device leaks on module unload
Make sure to drop the references taken when looking up the backend devices during vendor module unload.
--- drivers/perf/arm_cspmu/arm_cspmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/perf/arm_cspmu/arm_cspmu.c +3 -1
@@ -1365,8 +1365,10 @@ void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match)/* Unbind the driver from all matching backend devices. */ while ((dev =driver_find_device (&arm_cspmu_driver.driver,NULL , - match, arm_cspmu_match_device))) + match, arm_cspmu_match_device))) {device_release_driver (dev); +put_device (dev); + }mutex_lock (&arm_cspmu_lock);
Signature · 1 line
2.51.2
Will Deacon
maintainerQuoted 16 lines · Johan Hovold
Make sure to drop the references taken when looking up the backend devices during vendor module unload.
Fixes bfc653aa89cb ("perf: arm_cspmu: Separate Arm and vendor module")Cc [email protected] # 6.7Cc Besar Wicaksono <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/perf/arm_cspmu/arm_cspmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/perf/arm_cspmu/arm_cspmu.c +0
-0
drivers/perf/arm_cspmu/arm_cspmu.c void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match) · line 1371
Quoted 8 lines
drivers/perf/arm_cspmu/arm_cspmu.c +3
-1@@ -1365,8 +1365,10 @@ void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match)/* Unbind the driver from all matching backend devices. */ while ((dev =driver_find_device (&arm_cspmu_driver.driver,NULL , - match, arm_cspmu_match_device))) + match, arm_cspmu_match_device))) {device_release_driver (dev); +put_device (dev); + }
There's already a fix queued for this; please take a look:
Wil
Quoted 28 lines · Will Deacon
Quoted 16 lines · Johan Hovold
Make sure to drop the references taken when looking up the backend devices during vendor module unload.
Fixes bfc653aa89cb ("perf: arm_cspmu: Separate Arm and vendor module")Cc [email protected] # 6.7Cc Besar Wicaksono <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/perf/arm_cspmu/arm_cspmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/perf/arm_cspmu/arm_cspmu.c +0
-0drivers/perf/arm_cspmu/arm_cspmu.c void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match) · line 1371
Quoted 8 lines
drivers/perf/arm_cspmu/arm_cspmu.c +3
-1@@ -1365,8 +1365,10 @@ void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match)/* Unbind the driver from all matching backend devices. */ while ((dev =driver_find_device (&arm_cspmu_driver.driver,NULL , - match, arm_cspmu_match_device))) + match, arm_cspmu_match_device))) {device_release_driver (dev); +put_device (dev); + }There's already a fix queued for this; please take a look:
Ah, forgot to check linux-next here, sorry.
The diff of that commit is identical even if the commit summary is a bit misleading as this is not an error path.
Johan