aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/eventpoll.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 473e09da7d0..7a830797432 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1820,7 +1820,8 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
goto error_tgt_fput;
/* Check if EPOLLWAKEUP is allowed */
- if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
+ if ((epds.events & EPOLLWAKEUP) &&
+ (!capable(CAP_BLOCK_SUSPEND) || !IS_ENABLED(CONFIG_PM_SLEEP)))
epds.events &= ~EPOLLWAKEUP;
/*