diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 408f6b2a5fa8ee5c6578cd9e555a8386e112e370..48cc4c98e18bc8c418bd5ad4a956a79dbc30b702 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -217,7 +217,10 @@ int acpi_bind_one(struct device *dev, acpi_handle handle) /* Sanity check. */ if (pn->dev == dev) { dev_warn(dev, "Already associated with ACPI node\n"); - goto err_free; + if (ACPI_HANDLE(dev) == handle) + retval = 0; + + goto out_free; } if (pn->node_id == node_id) { physnode_list = &pn->node; @@ -255,10 +258,14 @@ int acpi_bind_one(struct device *dev, acpi_handle handle) put_device(dev); return retval; - err_free: + out_free: mutex_unlock(&acpi_dev->physical_node_lock); kfree(physical_node); - goto err; + if (retval) + goto err; + + put_device(dev); + return 0; } EXPORT_SYMBOL_GPL(acpi_bind_one);