Skip to content

Commit

Permalink
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/tip/tip

Pull timer fixes from Ingo Molnar.

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource : Nomadik-mtu : fix missing irq initialization
  posix-timer: Don't call idr_find() with out-of-range ID
  • Loading branch information
Linus Torvalds committed Feb 27, 2013
2 parents dcad0fc + 00f4e13 commit 24e5591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clocksource/nomadik-mtu.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ void __init nmdk_timer_init(void __iomem *base, int irq)
/* Timer 1 is used for events, register irq and clockevents */
setup_irq(irq, &nmdk_timer_irq);
nmdk_clkevt.cpumask = cpumask_of(0);
nmdk_clkevt.irq = irq;
clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU);

mtu_delay_timer.read_current_timer = &nmdk_timer_read_current_timer;
Expand Down
7 changes: 7 additions & 0 deletions kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,13 @@ static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags)
{
struct k_itimer *timr;

/*
* timer_t could be any type >= int and we want to make sure any
* @timer_id outside positive int range fails lookup.
*/
if ((unsigned long long)timer_id > INT_MAX)
return NULL;

rcu_read_lock();
timr = idr_find(&posix_timers_id, (int)timer_id);
if (timr) {
Expand Down

0 comments on commit 24e5591

Please sign in to comment.