From 315a9c791b6e37029293ec78839dd9899d6bb223 Mon Sep 17 00:00:00 2001 From: kumarsgoyal Date: Tue, 17 Mar 2026 16:57:03 +0530 Subject: [PATCH] Fix: handle filenames with spaces in kernbench script Update the kernel source caching loop to correctly handle filenames containing spaces, newlines, and other special characters. The previous implementation used a for loop over backtick-evaluated `find`, which relied on word splitting and broke on filenames with whitespace. This resulted in errors such as: cat: ./tools/testing/selftests/devices/probe/boards/Dell: No such file or directory cat: Inc.,XPS: No such file or directory Replace the loop with a null-delimited `find` pipeline using `-print0` and `read -r -d ''`, ensuring all valid filenames are processed safely. Signed-off-by: Sahil Kumar --- utils/benchmark/kernbench-0.42/kernbench | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/benchmark/kernbench-0.42/kernbench b/utils/benchmark/kernbench-0.42/kernbench index 2d5817bed06..55418c116d4 100644 --- a/utils/benchmark/kernbench-0.42/kernbench +++ b/utils/benchmark/kernbench-0.42/kernbench @@ -96,9 +96,9 @@ make clean > /dev/null 2>&1 if [[ $fast_run -eq 0 ]] ; then echo Caching kernel source in ram... - for i in `find -type f` + find . -type f -print0 | while IFS= read -r -d '' i; do - cat $i > /dev/null + cat "$i" > /dev/null done fi