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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 17, 2015 at 04:20:40PM -0500, David Miller wrote:
> From: Tejun Heo <tj@xxxxxxxxxx>
> Date: Tue, 17 Nov 2015 14:40:37 -0500
> 
> > +	static char path_buf[PATH_MAX];	/* protected by kernfs_mutex */
> > +	int len = strlen(path);
>  ...
> > +	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
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux