aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/base/power/wakeup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index f1cf53abd32b..e730f64cffcb 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -677,7 +677,7 @@ void pm_get_active_wakeup_sources(char *pending_wakeup_source, size_t max)
rcu_read_lock();
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
- if (ws->active) {
+ if (ws->active && len < max) {
if (!active)
len += scnprintf(pending_wakeup_source, max,
"Pending Wakeup Sources: ");