Presently, check_resctrlfs_support() tries to open "/sys/fs/resctrl" and will also look for resctrl mount point in "/proc/mounts" even if resctrl file system is not supported. Both the above will fail if resctrl file system is not supported. Hence, return immediately if resctrl file system is not supported. Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test") Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@xxxxxxxxx> --- tools/testing/selftests/resctrl/resctrlfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c index 727e667e2cc9..e43ddebd1aa4 100644 --- a/tools/testing/selftests/resctrl/resctrlfs.c +++ b/tools/testing/selftests/resctrl/resctrlfs.c @@ -581,6 +581,9 @@ bool check_resctrlfs_support(void) printf("%sok kernel supports resctrl filesystem\n", ret ? "" : "not "); tests_run++; + if (!ret) + return ret; + dp = opendir(RESCTRL_PATH); printf("%sok resctrl mountpoint \"%s\" exists\n", dp ? "" : "not ", RESCTRL_PATH); -- 2.19.1