]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: cgroup: fix cleanup path in test_memcg_subtree_control()
authorRoman Gushchin <guro@fb.com>
Mon, 8 Apr 2019 22:12:30 +0000 (15:12 -0700)
committerShuah Khan <shuah@kernel.org>
Mon, 8 Apr 2019 22:44:22 +0000 (16:44 -0600)
commitc261443379159e6ffd0b03fa030da148ed3aa1d9
tree64e018ae764324140b73f0f751973c579f653bea
parent40afb49c6a5c5e782b91ba2b891315c05e97fb75
selftests: cgroup: fix cleanup path in test_memcg_subtree_control()

Dan reported, that cleanup path in test_memcg_subtree_control()
triggers a static checker warning:
  ./tools/testing/selftests/cgroup/test_memcontrol.c:76 \
  test_memcg_subtree_control()
  error: uninitialized symbol 'child2'.

Fix this by initializing child2 and parent2 variables and
split the cleanup path into few stages.

Signed-off-by: Roman Gushchin <guro@fb.com>
Fixes: 41a34f6f69eb ("selftests: cgroup: add memory controller self-tests")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>
tools/testing/selftests/cgroup/test_memcontrol.c