Skip to content

Commit

Permalink
stress-mmaphuge: fix inverted MAP_FAILED check on madvise calls
Browse files Browse the repository at this point in the history
The check is inverted, fix it.

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Feb 20, 2025
1 parent e0a5d56 commit 91af53e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stress-mmaphuge.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int stress_mmaphuge_child(stress_args_t *args, void *v_context)
}

for (i = 0; LIKELY(stress_continue(args) && (i < context->mmaphuge_mmaps)); i++) {
if (bufs[i].buf != MAP_FAILED)
if (bufs[i].buf == MAP_FAILED)
continue;
/* Try Transparent Huge Pages THP */
#if defined(MADV_HUGEPAGE)
Expand Down

0 comments on commit 91af53e

Please sign in to comment.