selftests: cgroup: Add 'malloc' failures checks in test_memcontrol
authorIvan Orlov <ivan.orlov0322@gmail.com>
Sun, 26 Feb 2023 13:16:33 +0000 (16:16 +0300)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 28 Mar 2023 16:25:25 +0000 (10:25 -0600)
commitc83f320e55a49abd90629f42a72897afd579e0de
tree2b612642d221787c09f6c159a8f49d676a5b62cc
parent350d216dc2507daa03074a3079f0d654eadcac13
selftests: cgroup: Add 'malloc' failures checks in test_memcontrol

There are several 'malloc' calls in test_memcontrol, which can be
unsuccessful. This patch will add 'malloc' failures checking to
give more details about test's fail reasons and avoid possible
undefined behavior during the future null dereference (like the
one in alloc_anon_50M_check_swap function).

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/cgroup/test_memcontrol.c