Skip to content

Commit

Permalink
selftests: KVM: Fix check for !POLLIN in demand_paging_test
Browse files Browse the repository at this point in the history
The logical not operator applies only to the left hand side of a bitwise
operator. As such, the check for POLLIN not being set in revents wrong.
Fix it by adding parentheses around the bitwise expression.

Fixes: 4f72180 ("KVM: selftests: Add demand paging content to the demand paging test")
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20210921171121.2148982-2-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Oliver Upton authored and Paolo Bonzini committed Sep 22, 2021
1 parent 03a6e84 commit 90b5412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/demand_paging_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static void *uffd_handler_thread_fn(void *arg)
return NULL;
}

if (!pollfd[0].revents & POLLIN)
if (!(pollfd[0].revents & POLLIN))
continue;

r = read(uffd, &msg, sizeof(msg));
Expand Down

0 comments on commit 90b5412

Please sign in to comment.