lkml.org 
[lkml]   [2012]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cpuidle: fix an incorrect NULL pointer check
Date
From: Jonghwan Choi <jhbird.choi@samsung.com>

"cpu_dev" should be checked instead of "dev".

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
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;
--
1.7.1


\
 
 \ /
  Last update: 2012-01-14 21:13    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog