Re: [PATCH] cpuidle: fix an incorrect NULL pointer check

From: Deepthi Dharwar
Date: Mon Jan 16 2012 - 06:13:20 EST


On 01/14/2012 04:12 AM, jhbird.choi@xxxxxxxxxxx wrote:

> From: Jonghwan Choi <jhbird.choi@xxxxxxxxxxx>
>
> "cpu_dev" should be checked instead of "dev".
>
> Signed-off-by: Jonghwan Choi <jhbird.choi@xxxxxxxxxxx>
> ---
> drivers/cpuidle/cpuidle.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> 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: Deepthi Dharwar <deepthi@xxxxxxxxxxxxxxxxxx>

Cheers
Deepthi

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/