aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/glue.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index dcba319ac3f1..f3ead0ce37ab 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -225,11 +225,15 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
225 list_for_each_entry(pn, &acpi_dev->physical_node_list, node) { 225 list_for_each_entry(pn, &acpi_dev->physical_node_list, node) {
226 /* Sanity check. */ 226 /* Sanity check. */
227 if (pn->dev == dev) { 227 if (pn->dev == dev) {
228 mutex_unlock(&acpi_dev->physical_node_lock);
229
228 dev_warn(dev, "Already associated with ACPI node\n"); 230 dev_warn(dev, "Already associated with ACPI node\n");
229 if (ACPI_HANDLE(dev) == handle) 231 kfree(physical_node);
230 retval = 0; 232 if (ACPI_HANDLE(dev) != handle)
233 goto err;
231 234
232 goto out_free; 235 put_device(dev);
236 return 0;
233 } 237 }
234 if (pn->node_id == node_id) { 238 if (pn->node_id == node_id) {
235 physnode_list = &pn->node; 239 physnode_list = &pn->node;
@@ -262,15 +266,6 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
262 ACPI_HANDLE_SET(dev, NULL); 266 ACPI_HANDLE_SET(dev, NULL);
263 put_device(dev); 267 put_device(dev);
264 return retval; 268 return retval;
265
266 out_free:
267 mutex_unlock(&acpi_dev->physical_node_lock);
268 kfree(physical_node);
269 if (retval)
270 goto err;
271
272 put_device(dev);
273 return 0;
274} 269}
275EXPORT_SYMBOL_GPL(acpi_bind_one); 270EXPORT_SYMBOL_GPL(acpi_bind_one);
276 271