coresight: Fix the ACPI memory leak
PATCH 1/1 coresight: Fix the ACPI memory leak
The ACPI buffer memory (buf.pointer) should be freed as the buffer is not used after returning from acpi_get_dsd_graph(), free it to prevent memory leak.
Fixes 76ffa5ab5b79 ("coresight: Support for ACPI bindings")
Signed-off-by Junhao He <[email protected]>
--- drivers/hwtracing/coresight/coresight-platform.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-platform.c +4 -1
@@ -524,12 +524,15 @@ acpi_get_dsd_graph(struct acpi_device *adev)/* Skip the non-Graph _DSD packages */ if (!is_acpi_dsd_graph_guid (guid))continue ; -if (acpi_validate_dsd_graph (package)) +if (acpi_validate_dsd_graph (package)) { +ACPI_FREE (buf.pointer);return package; + }/* Invalid graph format, continue */ dev_warn (&adev->dev,"Invalid Graph _DSD property\n" ); } +ACPI_FREE (buf.pointer);return NULL ; }
Signature · 7 lines
2.33.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel