Re: [patch 06/15] clocksource: Split out user string input

From: Thomas Gleixner
Date: Wed May 15 2013 - 05:41:55 EST


On Mon, 29 Apr 2013, John Stultz wrote:
> On Thu, Apr 25, 2013 at 1:31 PM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> 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;
> }
>
> /**
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/