diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bc577dcc0e47..a610ca771558 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2377,9 +2377,10 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf, | |||
2377 | int i; | 2377 | int i; |
2378 | size_t ret; | 2378 | size_t ret; |
2379 | 2379 | ||
2380 | ret = cnt; | ||
2381 | |||
2380 | if (cnt > max_tracer_type_len) | 2382 | if (cnt > max_tracer_type_len) |
2381 | cnt = max_tracer_type_len; | 2383 | cnt = max_tracer_type_len; |
2382 | ret = cnt; | ||
2383 | 2384 | ||
2384 | if (copy_from_user(&buf, ubuf, cnt)) | 2385 | if (copy_from_user(&buf, ubuf, cnt)) |
2385 | return -EFAULT; | 2386 | return -EFAULT; |
@@ -2412,8 +2413,8 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf, | |||
2412 | out: | 2413 | out: |
2413 | mutex_unlock(&trace_types_lock); | 2414 | mutex_unlock(&trace_types_lock); |
2414 | 2415 | ||
2415 | if (ret == cnt) | 2416 | if (ret > 0) |
2416 | filp->f_pos += cnt; | 2417 | filp->f_pos += ret; |
2417 | 2418 | ||
2418 | return ret; | 2419 | return ret; |
2419 | } | 2420 | } |