[PATCH] arm: fix oops in sched_clock_poll

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Jul 8 12:44:13 EDT 2011


On Thu, Jan 20, 2011 at 12:47:21AM +0800, tom.leiming at gmail.com wrote:
> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
> index 9a46370..782dd08 100644
> --- a/arch/arm/kernel/sched_clock.c
> +++ b/arch/arm/kernel/sched_clock.c
> @@ -21,7 +21,9 @@ static void (*sched_clock_update_fn)(void);
>  static void sched_clock_poll(unsigned long wrap_ticks)
>  {
>  	mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks));
> -	sched_clock_update_fn();
> +
> +	if (sched_clock_update_fn)
> +		sched_clock_update_fn();
>  }

This is the wrong solution.  At this point there must be an update
function.  sched_clock must already be up and running by the time
sched_clock_postinit() is called.



More information about the linux-arm-kernel mailing list