Skip to content

Commit

Permalink
ACPI: processor: perflib: Rearrange unregistration routine
Browse files Browse the repository at this point in the history
Rearrange acpi_processor_unregister_performance() to follow a more
common error handling pattern and drop a redundant "return" statement
from the end of it.

No expected functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Rafael J. Wysocki committed Dec 7, 2022
1 parent d8f4ed0 commit 5be583c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/acpi/processor_perflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,18 +754,15 @@ void acpi_processor_unregister_performance(unsigned int cpu)
mutex_lock(&performance_mutex);

pr = per_cpu(processors, cpu);
if (!pr) {
mutex_unlock(&performance_mutex);
return;
}
if (!pr)
goto unlock;

if (pr->performance)
kfree(pr->performance->states);

pr->performance = NULL;

unlock:
mutex_unlock(&performance_mutex);

return;
}
EXPORT_SYMBOL(acpi_processor_unregister_performance);

0 comments on commit 5be583c

Please sign in to comment.