]> git.baikalelectronics.ru Git - kernel.git/commit
Fix cg_read_strcmp()
authorJay Kamat <jgkamat@fb.com>
Fri, 7 Sep 2018 21:34:04 +0000 (14:34 -0700)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Fri, 7 Sep 2018 22:35:51 +0000 (16:35 -0600)
commitd4ab4bc66a94abc8bde36b305dcedef3ce6a674e
treee5b2580305fc8e63823a7557c5c1634265f03ad0
parente305c737b8702fc17b04db3919faac14f19ef419
Fix cg_read_strcmp()

Fix a couple issues with cg_read_strcmp(), to improve correctness of
cgroup tests
- Fix cg_read_strcmp() always returning 0 for empty "needle" strings.
Previously, this function read to a size = 1 buffer when comparing
against empty strings, which would lead to cg_read_strcmp() comparing
two empty strings.
- Fix a memory leak in cg_read_strcmp()

Fixes: 4b7b23705ad3 ("selftests: cgroup: add memory controller self-tests")
Signed-off-by: Jay Kamat <jgkamat@fb.com>
Acked-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/cgroup/cgroup_util.c