Skip to content

Commit

Permalink
Fix crash when memhog uses local policy
Browse files Browse the repository at this point in the history
`memhog 1G local` will cause crash, because local policy don't
need nodelist, but we still parse nodestring.
  • Loading branch information
luochunsheng authored and andikleen committed Aug 25, 2022
1 parent 1de4ad7 commit 6643445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion memhog.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main(int ac, char **av)
if (policy == MPOL_MAX)
usage();

if (policy != MPOL_DEFAULT)
if (policy != MPOL_DEFAULT && policy != MPOL_LOCAL)
nodes = numa_parse_nodestring(av[3]);
if (!nodes) {
printf ("<%s> is invalid\n", av[3]);
Expand Down

0 comments on commit 6643445

Please sign in to comment.