]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:35 +0000 (06:43 -0700)
commit930d69e957979cb4dd52baf2be667f07e25d9762
tree3626d872c45c5cd91361141780db3a1d5a64254d
parentccbab981dee6089f0e2eff8516b0619fb2e5614c
selftests: cgroup: fix cleanup path in test_memcg_subtree_control()

[ Upstream commit e14d314c7a489f060d6d691866fef5f131281718 ]

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: 84092dbcf901 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/cgroup/test_memcontrol.c