projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a14e37
)
tools/vm/page_owner_sort.c: check malloc() return
author
Tang Bin
<tangbin@cmss.chinamobile.com>
Tue, 29 Jun 2021 02:35:07 +0000
(19:35 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Tue, 29 Jun 2021 17:53:47 +0000
(10:53 -0700)
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>
tools/vm/page_owner_sort.c
patch
|
blob
|
history
diff --git
a/tools/vm/page_owner_sort.c
b/tools/vm/page_owner_sort.c
index 85eb65ea16d30b476845bb135d62e0e64c62ba21..0e75f22c94750b8e375f81c13e3b2851d1f7e88a 100644
(file)
--- a/
tools/vm/page_owner_sort.c
+++ b/
tools/vm/page_owner_sort.c
@@
-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");