diff options
author | Ilya Leoshkevich <[email protected]> | 2023-01-28 01:06:26 +0100 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-01-28 12:30:08 -0800 |
commit | 804acdd251e837bb1a588074752d69698ac36b5f (patch) | |
tree | d5a4483110c5ae08784715545b7f1e2ba1d5ae58 | |
parent | 31da9be64a1136e5699a1fc59a45001d6b98acdc (diff) |
selftests/bpf: Set errno when urand_spawn() fails
The result of urand_spawn() is checked with ASSERT_OK_PTR, which treats
NULL as success if errno == 0.
Signed-off-by: Ilya Leoshkevich <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/usdt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/usdt.c b/tools/testing/selftests/bpf/prog_tests/usdt.c index 9ad9da0f215e..56ed1eb9b527 100644 --- a/tools/testing/selftests/bpf/prog_tests/usdt.c +++ b/tools/testing/selftests/bpf/prog_tests/usdt.c @@ -314,6 +314,7 @@ static FILE *urand_spawn(int *pid) if (fscanf(f, "%d", pid) != 1) { pclose(f); + errno = EINVAL; return NULL; } |