From 9aab8c596af5dd2188e275d8e60a111a2e679e39 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Wed, 15 Jul 2009 15:44:18 +0200 Subject: [PATCH] --- yaml --- r: 158227 b: refs/heads/master c: 2051cade7ccbe45a8bf8b7809d56b23d6d75ad03 h: refs/heads/master i: 158225: 33b201534d8f3bf7fe6c67c6fbbd68ce4ef117b1 158223: f673fe11a88e2495a8e732ed85b9db1b4dc088ea v: v3 --- [refs] | 2 +- trunk/drivers/oprofile/oprof.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index fbe7bdb46ecd..b3bc20b2e00e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6bfccd099c2841e1c42530f1b6d2553bfa13be3a +refs/heads/master: 2051cade7ccbe45a8bf8b7809d56b23d6d75ad03 diff --git a/trunk/drivers/oprofile/oprof.c b/trunk/drivers/oprofile/oprof.c index 7bc64af7cf99..42c9c765f9f1 100644 --- a/trunk/drivers/oprofile/oprof.c +++ b/trunk/drivers/oprofile/oprof.c @@ -196,6 +196,7 @@ void oprofile_shutdown(void) int oprofile_set_timeout(unsigned long val_msec) { int err = 0; + unsigned long time_slice; mutex_lock(&start_mutex); @@ -209,9 +210,13 @@ int oprofile_set_timeout(unsigned long val_msec) goto out; } - timeout_jiffies = msecs_to_jiffies(val_msec); - if (timeout_jiffies == MAX_JIFFY_OFFSET) - timeout_jiffies = msecs_to_jiffies(MULTIPLEXING_TIMER_DEFAULT); + time_slice = msecs_to_jiffies(val_msec); + if (time_slice == MAX_JIFFY_OFFSET) { + err = -EINVAL; + goto out; + } + + timeout_jiffies = time_slice; out: mutex_unlock(&start_mutex);