]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
clocksource: check range
authorDavid Howells <dhowells@redhat.com>
Wed, 20 Aug 2008 23:37:26 +0000 (16:37 -0700)
committerIngo Molnar <mingo@elte.hu>
Thu, 21 Aug 2008 07:50:23 +0000 (09:50 +0200)
Check that the value being passed to parse_pmtmr() does not exceed the
limits of pmtmr_ioport.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
drivers/clocksource/acpi_pm.c

index 5ca1d80de182bfa3bb333f0aeca907f7929ed26c..3df338481004c0bbdf69debbca9dd4d69b6bd026 100644 (file)
@@ -226,9 +226,12 @@ static int __init parse_pmtmr(char *arg)
 
        if (strict_strtoul(arg, 16, &base))
                return -EINVAL;
-
+#ifdef CONFIG_X86_64
+       if (base > UINT_MAX)
+               return -ERANGE;
+#endif
        printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
-              (unsigned int)pmtmr_ioport, base);
+              pmtmr_ioport, base);
        pmtmr_ioport = base;
 
        return 1;