From: Lu Dai Date: Sat, 4 May 2024 15:01:06 +0000 (+0300) Subject: selftests: kselftest_deps: fix l5_test() empty variable X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=17909476d631979927109187cc7e89e4577ff5be;p=linux.git selftests: kselftest_deps: fix l5_test() empty variable In the function l5_test(), variable $tests is empty when there is no .mk file in the subsystem to be tested. It causes the following grep operation get stuck. This fix check the variable $tests, return when it is empty. Signed-off-by: Lu Dai Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/kselftest_deps.sh b/tools/testing/selftests/kselftest_deps.sh index de59cc8f03c3f..487e49fdf2a62 100755 --- a/tools/testing/selftests/kselftest_deps.sh +++ b/tools/testing/selftests/kselftest_deps.sh @@ -244,6 +244,7 @@ l4_test() l5_test() { tests=$(find $(dirname "$test") -type f -name "*.mk") + [[ -z "${tests// }" ]] && return test_libs=$(grep "^IOURING_EXTRA_LIBS +\?=" $tests | \ cut -d "=" -f 2)