]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/vm: fix errno handling in mrelease_test
authorAdam Sindelar <adam@wowsignal.io>
Mon, 4 Jul 2022 17:33:51 +0000 (19:33 +0200)
committerakpm <akpm@linux-foundation.org>
Sat, 30 Jul 2022 01:07:14 +0000 (18:07 -0700)
commitd6a7b38980c370a0b25aaee1b5fe1a5741f2cdd6
tree14caa1f22d1453c7b0d988f98060df419a3ebb72
parentb349d2c0acceab8f88e06f3ab48ff7e28d2c2f50
selftests/vm: fix errno handling in mrelease_test

mrelease_test should return KSFT_SKIP when process_mrelease is not
defined, but due to a perror call consuming the errno, it returns
KSFT_FAIL.

This patch decides the exit code before calling perror.

[adam@wowsignal.io: fix remaining instances of errno mishandling]
Link: https://lkml.kernel.org/r/20220706141602.10159-1-adam@wowsignal.io
Link: https://lkml.kernel.org/r/20220704173351.19595-1-adam@wowsignal.io
Fixes: b61973f0dcc8 ("selftests: vm: add process_mrelease tests")
Signed-off-by: Adam Sindelar <adam@wowsignal.io>
Reviewed-by: David Vernet <void@manifault.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/vm/mrelease_test.c