aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-06-02 08:02:14 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-06-02 08:02:14 -0700
commit3a862e3b1047a081061d5ea207a7db3ec47a2e6d (patch)
tree6c027ea1b4b425a69ade81c7b0a074b1cd4fc3f0
parent0317b3d082a2120900123744aeaadd871133e724 (diff)
Fix MSAN reported error
-rw-r--r--src/core/iomgr/pollset_posix.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index 0a18d18671..1055006740 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -389,11 +389,13 @@ static int basic_pollset_maybe_work(grpc_pollset *pollset,
if (pfd[0].revents & POLLIN) {
grpc_pollset_kick_consume(&pollset->kick_state, kfd);
}
- if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) {
- grpc_fd_become_readable(fd, allow_synchronous_callback);
- }
- if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) {
- grpc_fd_become_writable(fd, allow_synchronous_callback);
+ if (nfds > 1) {
+ if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) {
+ grpc_fd_become_readable(fd, allow_synchronous_callback);
+ }
+ if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) {
+ grpc_fd_become_writable(fd, allow_synchronous_callback);
+ }
}
}