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>
This commit is contained in:
David Howells 2008-08-20 16:37:26 -07:00 committed by Ingo Molnar
parent 6a55617ed5
commit ee974e01e5

View 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;