Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116678
b: refs/heads/master
c: c2931e0
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Oct 14, 2008
1 parent 33219b9 commit c77625f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ea2e6d71aafe35b8aaf89ed711a283815acfae6
refs/heads/master: c2931e05ec5965597cbfb79ad332d4a29aeceb23
13 changes: 10 additions & 3 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2381,9 +2381,11 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
struct tracer *t;
char buf[max_tracer_type_len+1];
int i;
size_t ret;

if (cnt > max_tracer_type_len)
cnt = max_tracer_type_len;
ret = cnt;

if (copy_from_user(&buf, ubuf, cnt))
return -EFAULT;
Expand All @@ -2399,7 +2401,11 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
if (strcmp(t->name, buf) == 0)
break;
}
if (!t || t == current_trace)
if (!t) {
ret = -EINVAL;
goto out;
}
if (t == current_trace)
goto out;

if (current_trace && current_trace->reset)
Expand All @@ -2412,9 +2418,10 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
out:
mutex_unlock(&trace_types_lock);

filp->f_pos += cnt;
if (ret == cnt)
filp->f_pos += cnt;

return cnt;
return ret;
}

static ssize_t
Expand Down

0 comments on commit c77625f

Please sign in to comment.