diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index cf1856cb25d201c4e26af8e211d8c21e607189d0..71e917387ec386866c19d5a31db9bef0b8100b9c 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -574,7 +574,8 @@ static unsigned int userfaultfd_poll(struct file *file, poll_table *wait)
 			ret = POLLIN;
 		return ret;
 	default:
-		BUG();
+		WARN_ON_ONCE(1);
+		return POLLERR;
 	}
 }