aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-02-23 00:09:35 -0500
committerPaul Walmsley <paul@pwsan.com>2010-02-24 19:45:15 -0500
commitad9561609c41f704fd82facd37127e957bcaea94 (patch)
tree13599ee81f5c6b673d72b1fb126f79e386234ab7 /arch/arm/mach-omap2
parent43b40992ce21def8d5957f32d7ddb728af89bfce (diff)
OMAP clockdomain: if no autodeps exist, don't try to add or remove them
_clkdm_add_autodeps() and _clkdm_del_autodeps() will attempt to dereference a NULL pointer if no autodeps were supplied to clkdm_init(). Based on a patch from Roel Kluin <roel.kluin@gmail.com> - thanks Roel. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Roel Kluin <roel.kluin@gmail.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/clockdomain.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index de4278c19029..b26d30a14303 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -173,6 +173,9 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
173{ 173{
174 struct clkdm_autodep *autodep; 174 struct clkdm_autodep *autodep;
175 175
176 if (!autodeps)
177 return;
178
176 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 179 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
177 if (IS_ERR(autodep->clkdm.ptr)) 180 if (IS_ERR(autodep->clkdm.ptr))
178 continue; 181 continue;
@@ -201,6 +204,9 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
201{ 204{
202 struct clkdm_autodep *autodep; 205 struct clkdm_autodep *autodep;
203 206
207 if (!autodeps)
208 return;
209
204 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 210 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
205 if (IS_ERR(autodep->clkdm.ptr)) 211 if (IS_ERR(autodep->clkdm.ptr))
206 continue; 212 continue;