projects/linux·commit e88958e6

net: handle NULL ->poll gracefully

e88958e6 · Christoph Hellwig <[email protected]> · 2018-06-29 15:37:24 +02:00

The big aio poll revert broke various network protocols that don't
implement ->poll as a patch in the aio poll serie removed sock_no_poll
and made the common code handle this case.

Reported-by: [email protected]
Reported-by: [email protected]
Reported-by: [email protected]
Reported-by: Tetsuo Handa <[email protected]>
Fixes: a11e1d432b51 ("Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL")
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
e88958e6369aeba48623afa18dd67fdf41c98d75
Parents
90368a37

Changes

1 files changed · +2 −0

FileStatusAddDelContent
net/socket.cmodified+2−0View file

net/socket.c

View file
diff --git a/net/socket.c b/net/socket.c
index a564c6e..8563362 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1133,6 +1133,8 @@ static __poll_t sock_poll(struct file *file, poll_table *wait)
__poll_t events = poll_requested_events(wait);
sock_poll_busy_loop(sock, events);
+ if (!sock->ops->poll)
+ return 0;
return sock->ops->poll(file, sock, wait) | sock_poll_busy_flag(sock);
}