lkml.org 
[lkml]   [2013]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 06/15] clocksource: Split out user string input
On Mon, 29 Apr 2013, John Stultz wrote:
> On Thu, Apr 25, 2013 at 1:31 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> So you probably want something like the following patch to fix this.

Yep, stupid me.

> thanks
> -john
>
>
>
> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
> index e9c4f04..5f6c324 100644
> --- a/kernel/time/clocksource.c
> +++ b/kernel/time/clocksource.c
> @@ -836,6 +836,8 @@ sysfs_show_current_clocksources(struct device *dev,
>
> static size_t clocksource_get_uname(const char *buf, char *dst, size_t cnt)
> {
> + size_t ret = cnt;
> +
> /* strings from sysfs write are not 0 terminated! */
> if (!cnt || cnt >= CS_NAME_LEN)
> return -EINVAL;
> @@ -846,7 +848,7 @@ static size_t clocksource_get_uname(const char *buf, char
> *dst, size_t cnt)
> if (cnt > 0)
> memcpy(dst, buf, cnt);
> dst[cnt] = 0;
> - return cnt;
> + return ret;
> }
>
> /**
>


\
 
 \ /
  Last update: 2013-05-15 12:21    [W:0.496 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site