From: David Howells Date: Wed, 20 Aug 2008 23:37:26 +0000 (-0700) Subject: clocksource: check range X-Git-Tag: v2.6.28-rc1~82^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ee974e01e5ef2914036f08c8e41d1a3fa8bfc9d9;p=linux-2.6-omap-h63xx.git clocksource: check range Check that the value being passed to parse_pmtmr() does not exceed the limits of pmtmr_ioport. Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar --- diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index 5ca1d80de18..3df33848100 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c @@ -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;