userfaultfd/selftests: fix retval check for userfaultfd_open()
authorPeter Xu <peterx@redhat.com>
Tue, 15 Dec 2020 03:14:05 +0000 (19:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2020 20:13:46 +0000 (12:13 -0800)
commit1e17a24edf9bef891bbdd02617eaab4fa6efcd7f
treecb7d97519d280f7dd7b29cf4fd38ed1f28323382
parent164c50be2878f4caf6d7973e8e0e438f182f4ded
userfaultfd/selftests: fix retval check for userfaultfd_open()

userfaultfd_open() returns 1 for errors rather than negatives.  Fix it on
all the callers so when UFFDIO_API failed the test will bail out.

Link: https://lkml.kernel.org/r/20201208024709.7701-3-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/vm/userfaultfd.c