Re: [PATCH v9 05/19] ACPI: processor: Fix memory leaks in error paths of processor_add()

From: Gavin Shan
Date: Wed May 01 2024 - 06:19:45 EST


On 5/1/24 00:24, Jonathan Cameron wrote:
If acpi_processor_get_info() returned an error, pr and the associated
pr->throttling.shared_cpu_map were leaked.

The unwind code was in the wrong order wrt to setup, relying on
some unwind actions having no affect (clearing variables that were
never set etc). That makes it harder to reason about so reorder
and add appropriate labels to only undo what was actually set up
in the first place.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

---
v9: New patch in response to Gavin noticing a memory leak later in the
series.
---
drivers/acpi/acpi_processor.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)


Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>