Skip to content

Commit

Permalink
stress-lockbus: make numa_mask nonclobberable and fix free
Browse files Browse the repository at this point in the history
The numa_mask pointer can be clobbered by longjmps so make it
non-clobberable. Also fix the macro name to numa_mask is free'd.

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Dec 20, 2024
1 parent 771529b commit 42bc911
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stress-lockbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static int stress_lockbus(stress_args_t *args)
return EXIT_FAILURE;
#endif
#if defined(HAVE_MISALIGNED_LOCKBUS)
stress_numa_mask_t *numa_mask;
NOCLOBBER stress_numa_mask_t *numa_mask;
#endif

buffer = (uint32_t*)stress_mmap_populate(NULL, BUFFER_SIZE,
Expand Down Expand Up @@ -262,7 +262,7 @@ static int stress_lockbus(stress_args_t *args)
stress_metrics_set(args, 0, "nanosecs per memory lock operation",
rate * STRESS_DBL_NANOSECOND, STRESS_METRIC_HARMONIC_MEAN);

#if defined(HAVE_MISALIGNED_NUMA)
#if defined(HAVE_MISALIGNED_LOCKBUS)
stress_numa_mask_free(numa_mask);
#endif
(void)munmap((void *)buffer, BUFFER_SIZE);
Expand Down

0 comments on commit 42bc911

Please sign in to comment.