• J
    Fix cg_read_strcmp() · 48c2bb0b
    Jay Kamat 提交于
    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: 84092dbc ("selftests: cgroup: add memory controller self-tests")
    Signed-off-by: NJay Kamat <jgkamat@fb.com>
    Acked-by: NRoman Gushchin <guro@fb.com>
    Signed-off-by: NShuah Khan (Samsung OSG) <shuah@kernel.org>
    48c2bb0b
cgroup_util.c 5.7 KB