aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/firmware/fw_filesystem.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/firmware/fw_filesystem.sh')
-rwxr-xr-xtools/testing/selftests/firmware/fw_filesystem.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
index 61f9b1dbbd9b..63c310cdac09 100755
--- a/tools/testing/selftests/firmware/fw_filesystem.sh
+++ b/tools/testing/selftests/firmware/fw_filesystem.sh
@@ -29,9 +29,11 @@ test_finish()
echo "$OLD_TIMEOUT" >/sys/class/firmware/timeout
fi
if [ "$OLD_FWPATH" = "" ]; then
- OLD_FWPATH=" "
+ # A zero-length write won't work; write a null byte
+ printf '\000' >/sys/module/firmware_class/parameters/path
+ else
+ echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path
fi
- echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path
rm -f "$FW"
rmdir "$FWPATH"
}