diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-06 15:05:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-06 15:05:15 -0500 |
commit | f0adc82064a5c28b34bdbc18e2d178c32094770b (patch) | |
tree | 42c051d53c978c722687a2dc341f2b54db271417 /drivers | |
parent | 43a723286f3cae795418c62bc41c3cce73791a81 (diff) | |
parent | 55835eb62fad1253c9e657a667549945e4be9759 (diff) |
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
lockdep, timer: Fix del_timer_sync() annotation
RTC: Prevents a division by zero in kernel code.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/class.c | 1 | ||||
-rw-r--r-- | drivers/rtc/interface.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 9583cbcc6b79..c404b61386bf 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -143,6 +143,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, | |||
143 | rtc->id = id; | 143 | rtc->id = id; |
144 | rtc->ops = ops; | 144 | rtc->ops = ops; |
145 | rtc->owner = owner; | 145 | rtc->owner = owner; |
146 | rtc->irq_freq = 1; | ||
146 | rtc->max_user_freq = 64; | 147 | rtc->max_user_freq = 64; |
147 | rtc->dev.parent = dev; | 148 | rtc->dev.parent = dev; |
148 | rtc->dev.class = rtc_class; | 149 | rtc->dev.class = rtc_class; |
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 925006d33109..a0c01967244d 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -464,6 +464,9 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq) | |||
464 | int err = 0; | 464 | int err = 0; |
465 | unsigned long flags; | 465 | unsigned long flags; |
466 | 466 | ||
467 | if (freq <= 0) | ||
468 | return -EINVAL; | ||
469 | |||
467 | spin_lock_irqsave(&rtc->irq_task_lock, flags); | 470 | spin_lock_irqsave(&rtc->irq_task_lock, flags); |
468 | if (rtc->irq_task != NULL && task == NULL) | 471 | if (rtc->irq_task != NULL && task == NULL) |
469 | err = -EBUSY; | 472 | err = -EBUSY; |