Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165212
b: refs/heads/master
c: 718fb0d
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Len Brown committed Sep 1, 2009
1 parent ab148d3 commit cb176d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49ae80c9944401222e47108883c486b5a5a24006
refs/heads/master: 718fb0de8ff88f71b3b91a8ee8e42e60c88e5128
20 changes: 12 additions & 8 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ static void acpi_device_release(struct device *dev)
struct acpi_device *acpi_dev = to_acpi_device(dev);

kfree(acpi_dev->pnp.cid_list);
if (acpi_dev->flags.hardware_id)
kfree(acpi_dev->pnp.hardware_id);
if (acpi_dev->flags.unique_id)
kfree(acpi_dev->pnp.unique_id);
kfree(acpi_dev);
}

Expand Down Expand Up @@ -1137,17 +1141,19 @@ static void acpi_device_set_id(struct acpi_device *device,
strcpy(device->pnp.hardware_id, hid);
device->flags.hardware_id = 1;
}
} else
device->pnp.hardware_id = NULL;
}
if (!device->flags.hardware_id)
device->pnp.hardware_id = "";

if (uid) {
device->pnp.unique_id = ACPI_ALLOCATE_ZEROED(strlen (uid) + 1);
if (device->pnp.unique_id) {
strcpy(device->pnp.unique_id, uid);
device->flags.unique_id = 1;
}
} else
device->pnp.unique_id = NULL;
}
if (!device->flags.unique_id)
device->pnp.unique_id = "";

if (cid_list || cid_add) {
struct acpica_device_id_list *list;
Expand Down Expand Up @@ -1362,10 +1368,8 @@ acpi_add_single_object(struct acpi_device **child,
end:
if (!result)
*child = device;
else {
kfree(device->pnp.cid_list);
kfree(device);
}
else
acpi_device_release(&device->dev);

return result;
}
Expand Down

0 comments on commit cb176d1

Please sign in to comment.