]> git.hungrycats.org Git - linux/commit
Fix cg_read_strcmp()
authorJay Kamat <jgkamat@fb.com>
Fri, 7 Sep 2018 21:34:04 +0000 (14:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:18:14 +0000 (09:18 +0200)
commit5d1a5a5eed92811ed0d28708e06fbec5143645d1
treede9522b70d4da1673c6eef3fd7d1f78d2b62cad2
parent636dd45360094596e37102811e6e631ae06eaf38
Fix cg_read_strcmp()

[ Upstream commit 48c2bb0b9cf863e0ed78e269f188ce65b73e0fd1 ]

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: 84092dbcf901 ("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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/cgroup/cgroup_util.c