rtc: Limit RTC PIE frequency

The RTC pie hrtimer is self rearming. We really need to limit the
frequency to something sensible. Thus limit it to the 8192Hz max
value from the rtc man documentation

Cc: Willy Tarreau <[email protected]>
Cc: [email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
[jstultz: slightly reworked to use RTC_MAX_FREQ value]
Signed-off-by: John Stultz <[email protected]>
This commit is contained in:
Thomas Gleixner 2011-07-22 09:12:51 +00:00 • committed by John Stultz
commit 6e7a333eaa
2 changed files with 4 additions and 1 deletions

View file

@ -708,7 +708,7 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq)
int err = 0;
unsigned long flags;
if (freq <= 0)
if (freq <= 0 || freq > RTC_MAX_FREQ)
return -EINVAL;
retry:
spin_lock_irqsave(&rtc->irq_task_lock, flags);