From: Paul Walmsley Date: Tue, 23 Feb 2010 05:09:35 +0000 (-0700) Subject: OMAP clockdomain: if no autodeps exist, don't try to add or remove them X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ad9561609c41f704fd82facd37127e957bcaea94;p=linux-beck.git 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 - thanks Roel. Signed-off-by: Paul Walmsley Cc: Roel Kluin --- 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) { 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;