lkml.org 
[lkml]   [2018]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[for-next][PATCH 2/6] tracing: Clear parser->idx if only spaces are read
    From: Changbin Du <changbin.du@intel.com>

    If only spaces were read while parsing the next string, then parser->idx should be
    cleared in order to make trace_parser_loaded() return false.

    Link: http://lkml.kernel.org/r/1516093350-12045-3-git-send-email-changbin.du@intel.com

    Acked-by: Namhyung Kim <namhyung@kernel.org>
    Signed-off-by: Changbin Du <changbin.du@intel.com>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    ---
    kernel/trace/trace.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
    index c00a31d18f8a..cb90435e63da 100644
    --- a/kernel/trace/trace.c
    +++ b/kernel/trace/trace.c
    @@ -1236,14 +1236,14 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
    cnt--;
    }

    + parser->idx = 0;
    +
    /* only spaces were written */
    if (isspace(ch) || !ch) {
    *ppos += read;
    ret = read;
    goto out;
    }
    -
    - parser->idx = 0;
    }

    /* read the non-space input */
    --
    2.15.1

    \
     
     \ /
      Last update: 2018-01-24 19:40    [W:4.287 / U:0.588 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site