Skip to content

Commit c4e7716

Browse files
gaurav1086gregkh
authored andcommitted
tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference
[ Upstream commit d830020 ] Haven't reproduced this issue. This PR is does a minor code cleanup. Signed-off-by: Gaurav Singh <gaurav1086@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Tejun Heo <tj@kernel.org> Cc: Michal Koutn <mkoutny@suse.com> Cc: Roman Gushchin <guro@fb.com> Cc: Christian Brauner <christian.brauner@ubuntu.com> Cc: Chris Down <chris@chrisdown.name> Link: http://lkml.kernel.org/r/20200726013808.22242-1-gaurav1086@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9f489d3 commit c4e7716

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/cgroup/cgroup_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int cg_read_strcmp(const char *cgroup, const char *control,
9595

9696
/* Handle the case of comparing against empty string */
9797
if (!expected)
98-
size = 32;
98+
return -1;
9999
else
100100
size = strlen(expected) + 1;
101101

0 commit comments

Comments
 (0)