aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-08-20 19:37:26 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-21 03:50:23 -0400
commitee974e01e5ef2914036f08c8e41d1a3fa8bfc9d9 (patch)
tree6d3c7bed6467837bdd8247b01e6f92d792bdd58c /drivers/clocksource
parent6a55617ed5d1aa62b850de2cf66f5ede2eef4825 (diff)
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 <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/acpi_pm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 5ca1d80de182..3df338481004 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -226,9 +226,12 @@ static int __init parse_pmtmr(char *arg)
226 226
227 if (strict_strtoul(arg, 16, &base)) 227 if (strict_strtoul(arg, 16, &base))
228 return -EINVAL; 228 return -EINVAL;
229 229#ifdef CONFIG_X86_64
230 if (base > UINT_MAX)
231 return -ERANGE;
232#endif
230 printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n", 233 printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
231 (unsigned int)pmtmr_ioport, base); 234 pmtmr_ioport, base);
232 pmtmr_ioport = base; 235 pmtmr_ioport = base;
233 236
234 return 1; 237 return 1;