Skip to content

Commit

Permalink
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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.
  • Loading branch information
Linus Torvalds committed Feb 6, 2011
2 parents 43a7232 + 55835eb commit f0adc82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/rtc/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
rtc->id = id;
rtc->ops = ops;
rtc->owner = owner;
rtc->irq_freq = 1;
rtc->max_user_freq = 64;
rtc->dev.parent = dev;
rtc->dev.class = rtc_class;
Expand Down
3 changes: 3 additions & 0 deletions drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq)
int err = 0;
unsigned long flags;

if (freq <= 0)
return -EINVAL;

spin_lock_irqsave(&rtc->irq_task_lock, flags);
if (rtc->irq_task != NULL && task == NULL)
err = -EBUSY;
Expand Down
6 changes: 5 additions & 1 deletion kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,14 @@ EXPORT_SYMBOL(try_to_del_timer_sync);
int del_timer_sync(struct timer_list *timer)
{
#ifdef CONFIG_LOCKDEP
unsigned long flags;

raw_local_irq_save(flags);
local_bh_disable();
lock_map_acquire(&timer->lockdep_map);
lock_map_release(&timer->lockdep_map);
local_bh_enable();
_local_bh_enable();
raw_local_irq_restore(flags);
#endif
/*
* don't use it in hardirq context, because it
Expand Down

0 comments on commit f0adc82

Please sign in to comment.