summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGaurav Singh <gaurav1086@gmail.com>2020-08-07 08:17:25 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-07 20:33:21 +0200
commitd830020656c5b68ced962ed3cb51a90e0a89d4c4 (patch)
tree2ca5cbed1b53e042f5371b37e7e05f718d41636a /tools
parenttools/: replace HTTP links with HTTPS ones (diff)
downloadlinux-d830020656c5b68ced962ed3cb51a90e0a89d4c4.tar.xz
linux-d830020656c5b68ced962ed3cb51a90e0a89d4c4.zip
tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/cgroup/cgroup_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
index 8a637ca7d73a..05853b0b8831 100644
--- a/tools/testing/selftests/cgroup/cgroup_util.c
+++ b/tools/testing/selftests/cgroup/cgroup_util.c
@@ -106,7 +106,7 @@ int cg_read_strcmp(const char *cgroup, const char *control,
/* Handle the case of comparing against empty string */
if (!expected)
- size = 32;
+ return -1;
else
size = strlen(expected) + 1;