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>
This commit is contained in:
parent
43b40992ce
commit
ad9561609c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue