aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/oprofile/oprof.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
index 7bc64af7cf99..42c9c765f9f1 100644
--- a/drivers/oprofile/oprof.c
+++ b/drivers/oprofile/oprof.c
@@ -196,6 +196,7 @@ post_sync:
196int oprofile_set_timeout(unsigned long val_msec) 196int oprofile_set_timeout(unsigned long val_msec)
197{ 197{
198 int err = 0; 198 int err = 0;
199 unsigned long time_slice;
199 200
200 mutex_lock(&start_mutex); 201 mutex_lock(&start_mutex);
201 202
@@ -209,9 +210,13 @@ int oprofile_set_timeout(unsigned long val_msec)
209 goto out; 210 goto out;
210 } 211 }
211 212
212 timeout_jiffies = msecs_to_jiffies(val_msec); 213 time_slice = msecs_to_jiffies(val_msec);
213 if (timeout_jiffies == MAX_JIFFY_OFFSET) 214 if (time_slice == MAX_JIFFY_OFFSET) {
214 timeout_jiffies = msecs_to_jiffies(MULTIPLEXING_TIMER_DEFAULT); 215 err = -EINVAL;
216 goto out;
217 }
218
219 timeout_jiffies = time_slice;
215 220
216out: 221out:
217 mutex_unlock(&start_mutex); 222 mutex_unlock(&start_mutex);