summaryrefslogtreecommitdiff
path: root/arch/s390/oprofile/init.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2011-05-10 19:13:42 +0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-05-10 19:13:43 +0400
commit3d8dcb3c76bb2930798f61675c33cce8945ab988 (patch)
treee66a26e9214bb4d9dc4d57bad238706b05662e1b /arch/s390/oprofile/init.c
parent83ace2701b81be549cca7af33c5b0499cb2602d6 (diff)
downloadlinux-3d8dcb3c76bb2930798f61675c33cce8945ab988.tar.xz
[S390] oprofile: fix min/max interval query checks
oprofile_min_interval and oprofile_max_interval are unsigned, checking for negative values doesn't work. Change hwsampler_query_min_interval and hwsampler_query_max_interval to return an unsigned long and check for a zero value instead. Reported-by: Nicolas Kaiser <nikai@nikai.net> Acked-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/oprofile/init.c')
-rw-r--r--arch/s390/oprofile/init.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c
index c63d7e58352b..5995e9bc72d9 100644
--- a/arch/s390/oprofile/init.c
+++ b/arch/s390/oprofile/init.c
@@ -145,15 +145,11 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops)
* create hwsampler files only if hwsampler_setup() succeeds.
*/
oprofile_min_interval = hwsampler_query_min_interval();
- if (oprofile_min_interval < 0) {
- oprofile_min_interval = 0;
+ if (oprofile_min_interval == 0)
return -ENODEV;
- }
oprofile_max_interval = hwsampler_query_max_interval();
- if (oprofile_max_interval < 0) {
- oprofile_max_interval = 0;
+ if (oprofile_max_interval == 0)
return -ENODEV;
- }
if (oprofile_timer_init(ops))
return -ENODEV;