Re: [PATCH stable 3.4] intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 25, 2014 at 11:00:34PM +0100, Daniel Kiper wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> 
> From: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
> 
> Upstream commit: 3735d524da64b70b41c764359da36f88aded3610

Thanks, I'm queuing this for the 3.5 kernel as well.

Cheers,
--
Luís

> 
> If the machine is booted without any cpu_idle driver set
> (b/c disable_cpuidle() has been called) we should follow
> other users of cpu_idle API and check the return value
> for NULL before using it.
> 
> Reported-and-tested-by: Mark van Dijk <mark@xxxxxxxxxxxxxx>
> Suggested-by: Jan Beulich <JBeulich@xxxxxxxx>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
> ---
>  drivers/idle/intel_idle.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index f559088..e872617 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -606,8 +606,9 @@ static int __init intel_idle_init(void)
>  	intel_idle_cpuidle_driver_init();
>  	retval = cpuidle_register_driver(&intel_idle_driver);
>  	if (retval) {
> +		struct cpuidle_driver *drv = cpuidle_get_driver();
>  		printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
> -			cpuidle_get_driver()->name);
> +			drv ? drv->name : "none");
>  		return retval;
>  	}
>  
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]