diff mbox

omap: pm: Fix error condition in _pwrdm_deps_lookup when pwrdm not found.

Message ID 1250100755-29723-1-git-send-email-mike@android.com (mailing list archive)
State Accepted
Delegated to: Kevin Hilman
Headers show

Commit Message

Mike Chan Aug. 12, 2009, 6:12 p.m. UTC
Check pwrdm_name instead of the address of a null struct when at the
end of pwrdm_dep array.

Reported-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Chan <mike@android.com>
---
 arch/arm/mach-omap2/powerdomain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Kevin Hilman Aug. 12, 2009, 10:53 p.m. UTC | #1
Mike Chan <mike@android.com> writes:

> Check pwrdm_name instead of the address of a null struct when at the
> end of pwrdm_dep array.
>
> Reported-by: Paul Walmsley <paul@pwsan.com>
> Signed-off-by: Mike Chan <mike@android.com>

Thanks, to keep it all together, I'll revert the original and merge
this into a single patch.

Kevin

> ---
>  arch/arm/mach-omap2/powerdomain.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index 0334609..02c1ef6 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -103,7 +103,7 @@ static struct powerdomain *_pwrdm_deps_lookup(struct powerdomain *pwrdm,
>  
>  	}
>  
> -	if (!pd)
> +	if (!pd->pwrdm_name)
>  		return ERR_PTR(-ENOENT);
>  
>  	return pd->pwrdm;
> -- 
> 1.5.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paul Walmsley Aug. 13, 2009, 6:08 a.m. UTC | #2
On Wed, 12 Aug 2009, Kevin Hilman wrote:

> Mike Chan <mike@android.com> writes:
> 
> > Check pwrdm_name instead of the address of a null struct when at the
> > end of pwrdm_dep array.
> >
> > Reported-by: Paul Walmsley <paul@pwsan.com>
> > Signed-off-by: Mike Chan <mike@android.com>
> 
> Thanks, to keep it all together, I'll revert the original and merge
> this into a single patch.

Great, then:

Acked-by: Paul Walmsley <paul@pwsan.com>

> 
> Kevin
> 
> > ---
> >  arch/arm/mach-omap2/powerdomain.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> > index 0334609..02c1ef6 100644
> > --- a/arch/arm/mach-omap2/powerdomain.c
> > +++ b/arch/arm/mach-omap2/powerdomain.c
> > @@ -103,7 +103,7 @@ static struct powerdomain *_pwrdm_deps_lookup(struct powerdomain *pwrdm,
> >  
> >  	}
> >  
> > -	if (!pd)
> > +	if (!pd->pwrdm_name)
> >  		return ERR_PTR(-ENOENT);
> >  
> >  	return pd->pwrdm;
> > -- 
> > 1.5.4.5
> 


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 0334609..02c1ef6 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -103,7 +103,7 @@  static struct powerdomain *_pwrdm_deps_lookup(struct powerdomain *pwrdm,
 
 	}
 
-	if (!pd)
+	if (!pd->pwrdm_name)
 		return ERR_PTR(-ENOENT);
 
 	return pd->pwrdm;