]> git.baikalelectronics.ru Git - kernel.git/commit
lib/test_meminit: add checks for the allocation functions
authorXiaoke Wang <xkernel.wang@foxmail.com>
Fri, 4 Mar 2022 09:12:15 +0000 (17:12 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 13 Oct 2022 01:51:49 +0000 (18:51 -0700)
commit5585fcf0f291bcdac4ac99ce2ba891cd4723819e
treee80c96410ea522b546a8b4163063cc81eec920ca
parent4dcfa991b8128ff09633c18b0068f267a440d1f5
lib/test_meminit: add checks for the allocation functions

alloc_pages(), kmalloc() and vmalloc() are all memory allocation functions
which can return NULL when some internal memory failures happen.  So it is
better to check the return of them to catch the failure in time for better
test them.

Link: https://lkml.kernel.org/r/tencent_D44A49FFB420EDCCBFB9221C8D14DFE12908@qq.com
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/test_meminit.c