Skip to content

Commit a8d51ef

Browse files
youngjunirafaeljw
authored andcommitted
PM: sleep: Drop spurious WARN_ON() from pm_restore_gfp_mask()
Commit 35e4a69 ("PM: sleep: Allow pm_restrict_gfp_mask() stacking") introduced refcount-based GFP mask management that warns when pm_restore_gfp_mask() is called with saved_gfp_count == 0. Some hibernation paths call pm_restore_gfp_mask() defensively where the GFP mask may or may not be restricted depending on the execution path. For example, the uswsusp interface invokes it in SNAPSHOT_CREATE_IMAGE, SNAPSHOT_UNFREEZE, and snapshot_release(). Before the stacking change this was a silent no-op; it now triggers a spurious WARNING. Remove the WARN_ON() wrapper from the !saved_gfp_count check while retaining the check itself, so that defensive calls remain harmless without producing false warnings. Fixes: 35e4a69 ("PM: sleep: Allow pm_restrict_gfp_mask() stacking") Signed-off-by: Youngjun Park <youngjun.park@lge.com> [ rjw: Subject tweak ] Link: https://patch.msgid.link/20260322120528.750178-1-youngjun.park@lge.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 734eba6 commit a8d51ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/power/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void pm_restore_gfp_mask(void)
4040
{
4141
WARN_ON(!mutex_is_locked(&system_transition_mutex));
4242

43-
if (WARN_ON(!saved_gfp_count) || --saved_gfp_count)
43+
if (!saved_gfp_count || --saved_gfp_count)
4444
return;
4545

4646
gfp_allowed_mask = saved_gfp_mask;

0 commit comments

Comments
 (0)