Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()

From
Tejun Heo <tj@kernel.org>
Date
2015-11-17 21:22:49
Also in
cgroups, lkml, netfilter-devel
Reply to
David Miller, 2015-11-17
On Tue, Nov 17, 2015 at 04:20:40PM -0500, David Miller wrote:
From: Tejun Heo <tj@kernel.org>
Date: Tue, 17 Nov 2015 14:40:37 -0500
quoted
+	static char path_buf[PATH_MAX];	/* protected by kernfs_mutex */
+	int len = strlen(path);
 ...
quoted
+	if (len >= PATH_MAX)
+		return NULL;
+
+	memcpy(path_buf, path, len + 1);
	static char path_buf[PATH_MAX];	/* protected by kernfs_mutex */
	int len = strlcpy(path_buf, path, PATH_MAX);
 ...
	if (len >= PATH_MAX)
		return NULL;
That's a lot better.  Will update.

Thanks.

-- 
tejun
Thread (22 messages) 22 messages, 4 authors, last reply 2015-11-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help