]> git.ipfire.org Git - thirdparty/linux.git/commit
PM: wakeup: Handle empty list in wakeup_sources_walk_start()
authorSamuel Wu <wusamuel@google.com>
Sat, 24 Jan 2026 01:21:29 +0000 (17:21 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 Feb 2026 20:39:21 +0000 (21:39 +0100)
commit75ce02f4bc9a8b8350b6b1b01872467b0cc960cc
tree24b7f1832b5e502663d03110d179917b32be147b
parent1081c1649da989ef9cbc01ffa99babc190df6077
PM: wakeup: Handle empty list in wakeup_sources_walk_start()

In the case of an empty wakeup_sources list, wakeup_sources_walk_start()
will return an invalid but non-NULL address. This also affects wrappers
of the aforementioned function, like for_each_wakeup_source().

Update wakeup_sources_walk_start() to return NULL in case of an empty
list.

Fixes: b4941adb24c0 ("PM: wakeup: Add routine to help fetch wakeup source object.")
Signed-off-by: Samuel Wu <wusamuel@google.com>
[ rjw: Subject and changelog edits ]
Link: https://patch.msgid.link/20260124012133.2451708-2-wusamuel@google.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/wakeup.c