mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
tools/vm/page_owner_sort.c: check malloc() return
Link: https://lkml.kernel.org/r/20210506131402.10416-1-tangbin@cmss.chinamobile.com Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
1a14e3779d
commit
85f29cd6a1
1 changed files with 4 additions and 0 deletions
|
@ -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");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue