diff options
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 686ec399f2a8..4d7e1498ae91 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -486,20 +486,11 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
486 | loff_t *ppos) | 486 | loff_t *ppos) |
487 | { | 487 | { |
488 | struct ftrace_event_call *call = filp->private_data; | 488 | struct ftrace_event_call *call = filp->private_data; |
489 | char buf[64]; | ||
490 | unsigned long val; | 489 | unsigned long val; |
491 | int ret; | 490 | int ret; |
492 | 491 | ||
493 | if (cnt >= sizeof(buf)) | 492 | ret = kstrtoul_from_user(ubuf, cnt, 10, &val); |
494 | return -EINVAL; | 493 | if (ret) |
495 | |||
496 | if (copy_from_user(&buf, ubuf, cnt)) | ||
497 | return -EFAULT; | ||
498 | |||
499 | buf[cnt] = 0; | ||
500 | |||
501 | ret = strict_strtoul(buf, 10, &val); | ||
502 | if (ret < 0) | ||
503 | return ret; | 494 | return ret; |
504 | 495 | ||
505 | ret = tracing_update_buffers(); | 496 | ret = tracing_update_buffers(); |
@@ -571,19 +562,10 @@ system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
571 | { | 562 | { |
572 | const char *system = filp->private_data; | 563 | const char *system = filp->private_data; |
573 | unsigned long val; | 564 | unsigned long val; |
574 | char buf[64]; | ||
575 | ssize_t ret; | 565 | ssize_t ret; |
576 | 566 | ||
577 | if (cnt >= sizeof(buf)) | 567 | ret = kstrtoul_from_user(ubuf, cnt, 10, &val); |
578 | return -EINVAL; | 568 | if (ret) |
579 | |||
580 | if (copy_from_user(&buf, ubuf, cnt)) | ||
581 | return -EFAULT; | ||
582 | |||
583 | buf[cnt] = 0; | ||
584 | |||
585 | ret = strict_strtoul(buf, 10, &val); | ||
586 | if (ret < 0) | ||
587 | return ret; | 569 | return ret; |
588 | 570 | ||
589 | ret = tracing_update_buffers(); | 571 | ret = tracing_update_buffers(); |