Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7a26b530 authored by Catalin Marinas's avatar Catalin Marinas Committed by Rafael J. Wysocki
Browse files

ACPI / scan: Fix memory leak on acpi_scan_init_hotplug() error path



Following commit 6b772e8f (ACPI: Update PNPID match handling for
notify), the acpi_scan_init_hotplug() calls acpi_set_pnp_ids() which
allocates acpi_hardware_id and copies a few strings (kstrdup). If the
devices does not have hardware_id set, the function exits without
freeing the previously allocated ids (and kmemleak complains). This
patch calls simply changes 'return' on error to a 'goto out' which
calls acpi_free_pnp_ids().

Reported-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarToshi Kani <toshi.kani@hp.com>
Tested-by: default avatarToshi Kani <toshi.kani@hp.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0ab5bb64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment