ACPI: Drop parent field from struct acpi_device
Hello Rafael J. Wysocki,
This is a semi-automatic email about new static checker warnings.
The patch 62fcb99bdf10: "ACPI: Drop parent field from struct acpi_device" from Aug 24, 2022, leads to the following Smatch complaint:
drivers/acpi/device_pm.c:166 acpi_device_set_power()
warn: variable dereferenced before check 'device' (see line 162)
drivers/acpi/device_pm.c
161 {
162 struct acpi_device *parent = acpi_dev_parent(device);
^^^^^^Dereverence
163 int target_state = state;
164 int result = 0;
165
166 if (!device || !device->flags.power_manageable
^^^^^^^
Checked too late.
167 || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD)) 168 return -EINVAL;
regards,
dan carpenter