Commit e0b7b24d authored by Wen Congyang's avatar Wen Congyang Committed by Rafael J. Wysocki

ACPI / memhotplug: free memory device if acpi_memory_enable_device() failed

If acpi_memory_enable_device() fails, acpi_memory_enable_device() will
return a non-zero value, which means we fail to bind the memory device to
this driver.  So we should free memory device before
acpi_memory_device_add() returns.
Signed-off-by: default avatarWen Congyang <>
Reviewed-by: default avatarYasuaki Ishimatsu <>
Acked-by: default avatarDavid Rientjes <>
Signed-off-by: default avatarRafael J. Wysocki <>
parent 386e52b9
......@@ -421,9 +421,11 @@ static int acpi_memory_device_add(struct acpi_device *device)
if (!acpi_memory_check_device(mem_device)) {
/* call add_memory func */
result = acpi_memory_enable_device(mem_device);
if (result)
if (result) {
"Error in acpi_memory_enable_device\n");
return result;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment