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);
}
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);
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;
end:
if (!result)
*child = device;
- else {
- kfree(device->pnp.cid_list);
- kfree(device);
- }
+ else
+ acpi_device_release(&device->dev);
return result;
}