mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
ACPI: PM: Fix device wakeup power reference counting error
[ Upstream commit452a3e723f
] Fix a device wakeup power reference counting error introduced by commita2d7b2e004
("ACPI: PM: Fix sharing of wakeup power resources") because of a coding mistake. Fixes:a2d7b2e004
("ACPI: PM: Fix sharing of wakeup power resources") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
27f2e5b914
commit
f0f8307c7d
@ -755,13 +755,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--;
|
||||
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;
|
||||
|
||||
if (--dev->wakeup.prepare_count > 0)
|
||||
goto out;
|
||||
|
||||
err = acpi_device_sleep_wake(dev, 0, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user