summaryrefslogtreecommitdiff
path: root/drivers/oprofile/oprofile_files.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oprofile/oprofile_files.c')
-rw-r--r--drivers/oprofile/oprofile_files.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c
index bbd7516e086..ccf099e684a 100644
--- a/drivers/oprofile/oprofile_files.c
+++ b/drivers/oprofile/oprofile_files.c
@@ -79,14 +79,17 @@ static ssize_t depth_write(struct file *file, char const __user *buf, size_t cou
if (*offset)
return -EINVAL;
+ if (!oprofile_ops.backtrace)
+ return -EINVAL;
+
retval = oprofilefs_ulong_from_user(&val, buf, count);
if (retval)
return retval;
- retval = oprofile_set_backtrace(val);
-
+ retval = oprofile_set_ulong(&oprofile_backtrace_depth, val);
if (retval)
return retval;
+
return count;
}