mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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:
parent
6a55617ed5
commit
ee974e01e5
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue