From: Colin Ian King Date: Wed, 19 Mar 2025 11:43:24 +0000 (+0000) Subject: PM: sleep: Fix bit masking operation X-Git-Tag: v6.15-rc1~191^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3860cbe239639503e56bd4365c6bf4cb957ef04e;p=thirdparty%2Fkernel%2Flinux.git PM: sleep: Fix bit masking operation The mask operation link->flags | DL_FLAG_PM_RUNTIME is always true which is incorrect. The mask operation should be using the bit-wise & operator. Fix this. Fixes: bca84a7b93fd ("PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally") Signed-off-by: Colin Ian King Link: https://patch.msgid.link/20250319114324.791829-1-colin.i.king@gmail.com Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index ad50018b80479..ac2a197c12344 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1836,7 +1836,7 @@ static bool device_prepare_smart_suspend(struct device *dev) idx = device_links_read_lock(); list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) { - if (!(link->flags | DL_FLAG_PM_RUNTIME)) + if (!(link->flags & DL_FLAG_PM_RUNTIME)) continue; if (!dev_pm_smart_suspend(link->supplier) &&