From: Rafael J. Wysocki Date: Mon, 5 Dec 2022 19:05:55 +0000 (+0100) Subject: ACPI: processor: perflib: Rearrange unregistration routine X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5be583c695ed4d94211cc28282a42092b137f988;p=linux.git ACPI: processor: perflib: Rearrange unregistration routine 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 --- diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 388f045580ff1..10d2999a57737 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -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);