rt-tests: cyclictest: Fix seg fault for verbose with no affinity maxk
PATCH 1/1 rt-tests: cyclictest: Fix seg fault for verbose with no affinity maxk
Using verbose with affinity and no affinity mask causes a segmentation mask. Fix this by checking if the affinity mask is NULL before printing the verbose message.
Reported-by Pierre Gondois <[email protected]>
Signed-off-by John Kacur <[email protected]>
--- src/cyclictest/cyclictest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/cyclictest/cyclictest.c +1 -1
@@ -1088,7 +1088,7 @@ static void process_options(int argc, char *argv[], int max_cpus)if (setaffinity ==AFFINITY_SPECIFIED && !affinity_mask)display_help (1 ); -if (verbose) +if (verbose && affinity_mask)printf ("Using %u cpus.\n" ,numa_bitmask_weight (affinity_mask));break ;
Signature · 1 line
2.36.1