aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/oprofilefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oprofile/oprofilefs.c')
-rw-r--r--drivers/oprofile/oprofilefs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 789a1a857ddf..1944621930d9 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -91,16 +91,20 @@ static ssize_t ulong_read_file(struct file *file, char __user *buf, size_t count
91 91
92static ssize_t ulong_write_file(struct file *file, char const __user *buf, size_t count, loff_t *offset) 92static ssize_t ulong_write_file(struct file *file, char const __user *buf, size_t count, loff_t *offset)
93{ 93{
94 unsigned long *value = file->private_data; 94 unsigned long value;
95 int retval; 95 int retval;
96 96
97 if (*offset) 97 if (*offset)
98 return -EINVAL; 98 return -EINVAL;
99 99
100 retval = oprofilefs_ulong_from_user(value, buf, count); 100 retval = oprofilefs_ulong_from_user(&value, buf, count);
101 if (retval)
102 return retval;
101 103
104 retval = oprofile_set_ulong(file->private_data, value);
102 if (retval) 105 if (retval)
103 return retval; 106 return retval;
107
104 return count; 108 return count;
105} 109}
106 110