Skip to content

Commit

Permalink
tools/vm/page_owner_sort.c: check malloc() return
Browse files Browse the repository at this point in the history
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Zhang Shengju <[email protected]>
Signed-off-by: Tang Bin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Tang Bin authored and torvalds committed Jun 29, 2021
1 parent 1a14e37 commit 85f29cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/vm/page_owner_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ int main(int argc, char **argv)
qsort(list, list_size, sizeof(list[0]), compare_txt);

list2 = malloc(sizeof(*list) * list_size);
if (!list2) {
printf("Out of memory\n");
exit(1);
}

printf("culling\n");

Expand Down

0 comments on commit 85f29cd

Please sign in to comment.