]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
OMAP clockdomain: if no autodeps exist, don't try to add or remove them
authorPaul Walmsley <paul@pwsan.com>
Tue, 23 Feb 2010 05:09:35 +0000 (22:09 -0700)
committerPaul Walmsley <paul@pwsan.com>
Thu, 25 Feb 2010 00:45:15 +0000 (17:45 -0700)
_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>
arch/arm/mach-omap2/clockdomain.c

index de4278c19029889fc1412f8a61a26ef8112b480c..b26d30a14303646f8f9eee15a8298b4072bd669e 100644 (file)
@@ -173,6 +173,9 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
 {
        struct clkdm_autodep *autodep;
 
+       if (!autodeps)
+               return;
+
        for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
                if (IS_ERR(autodep->clkdm.ptr))
                        continue;
@@ -201,6 +204,9 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
 {
        struct clkdm_autodep *autodep;
 
+       if (!autodeps)
+               return;
+
        for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
                if (IS_ERR(autodep->clkdm.ptr))
                        continue;