aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/container.c')
-rw-r--r--drivers/acpi/container.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 5f2c3c00a315..642bb305cb65 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -202,20 +202,17 @@ container_walk_namespace_cb(acpi_handle handle,
202 u32 lvl, void *context, void **rv) 202 u32 lvl, void *context, void **rv)
203{ 203{
204 char *hid = NULL; 204 char *hid = NULL;
205 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
206 struct acpi_device_info *info; 205 struct acpi_device_info *info;
207 acpi_status status; 206 acpi_status status;
208 int *action = context; 207 int *action = context;
209 208
210 209 status = acpi_get_object_info(handle, &info);
211 status = acpi_get_object_info(handle, &buffer); 210 if (ACPI_FAILURE(status)) {
212 if (ACPI_FAILURE(status) || !buffer.pointer) {
213 return AE_OK; 211 return AE_OK;
214 } 212 }
215 213
216 info = buffer.pointer;
217 if (info->valid & ACPI_VALID_HID) 214 if (info->valid & ACPI_VALID_HID)
218 hid = info->hardware_id.value; 215 hid = info->hardware_id.string;
219 216
220 if (hid == NULL) { 217 if (hid == NULL) {
221 goto end; 218 goto end;
@@ -242,7 +239,7 @@ container_walk_namespace_cb(acpi_handle handle,
242 } 239 }
243 240
244 end: 241 end:
245 kfree(buffer.pointer); 242 kfree(info);
246 243
247 return AE_OK; 244 return AE_OK;
248} 245}