diff options
author | Gaurav Singh <[email protected]> | 2020-08-06 23:17:25 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-08-07 11:33:21 -0700 |
commit | d830020656c5b68ced962ed3cb51a90e0a89d4c4 (patch) | |
tree | 2ca5cbed1b53e042f5371b37e7e05f718d41636a | |
parent | 79e3ea5aab48c83de9410e43b52895406847eca7 (diff) |
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Michal Koutn <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Chris Down <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | tools/testing/selftests/cgroup/cgroup_util.c | 2 |
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; |