Commit 452a3e72 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI: PM: Fix device wakeup power reference counting error

Fix a device wakeup power reference counting error introduced by
commit a2d7b2e0 ("ACPI: PM: Fix sharing of wakeup power
resources") because of a coding mistake.

Fixes: a2d7b2e0 ("ACPI: PM: Fix sharing of wakeup power resources")
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c0d6586a
......@@ -757,13 +757,11 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
mutex_lock(&acpi_device_lock);
if (dev->wakeup.prepare_count > 1) {
dev->wakeup.prepare_count--;
/* Do nothing if wakeup power has not been enabled for this device. */
if (dev->wakeup.prepare_count <= 0)
goto out;
}
/* Do nothing if wakeup power has not been enabled for this device. */
if (!dev->wakeup.prepare_count)
if (--dev->wakeup.prepare_count > 0)
goto out;
err = acpi_device_sleep_wake(dev, 0, 0, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment