[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200824082417.286266595@linuxfoundation.org>
Date: Mon, 24 Aug 2020 10:29:25 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Gaurav Singh <gaurav1086@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>, Tejun Heo <tj@...nel.org>,
Michal Koutn <mkoutny@...e.com>, Roman Gushchin <guro@...com>,
Christian Brauner <christian.brauner@...ntu.com>,
Chris Down <chris@...isdown.name>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.8 067/148] tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference
From: Gaurav Singh <gaurav1086@...il.com>
[ Upstream commit d830020656c5b68ced962ed3cb51a90e0a89d4c4 ]
Haven't reproduced this issue. This PR is does a minor code cleanup.
Signed-off-by: Gaurav Singh <gaurav1086@...il.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Reviewed-by: Andrew Morton <akpm@...ux-foundation.org>
Cc: Shuah Khan <shuah@...nel.org>
Cc: Tejun Heo <tj@...nel.org>
Cc: Michal Koutn <mkoutny@...e.com>
Cc: Roman Gushchin <guro@...com>
Cc: Christian Brauner <christian.brauner@...ntu.com>
Cc: Chris Down <chris@...isdown.name>
Link: http://lkml.kernel.org/r/20200726013808.22242-1-gaurav1086@gmail.com
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
tools/testing/selftests/cgroup/cgroup_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
index 8a637ca7d73a4..05853b0b88318 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;
--
2.25.1
Powered by blists - more mailing lists