Re: [patch] cpuidle: checking the wrong variable in __cpuidle_register_device()

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

 



On 01/09/2012 04:24 PM, Dan Carpenter wrote:

> We updated this in 8a25a2fd12 "cpu: convert 'cpu' and 'machinecheck'
> sysdev_class to a regular subsystem" but it should be checking "cpu_dev"
> here not "dev".  The "dev" variable was dereferenced already.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 59f4261..7771810 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -294,7 +294,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
>  	struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
>  	struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
> 
> -	if (!dev)
> +	if (!cpu_dev)
>  		return -EINVAL;
>  	if (!try_module_get(cpuidle_driver->owner))
>  		return -EINVAL;


Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@xxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux