public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Linux-OMAP <linux-omap@vger.kernel.org>
Cc: Nishanth Menon <nm@ti.com>, Ambresh K <ambresh@ti.com>,
	Eduardo Valentin <eduardo.valentin@nokia.com>,
	Kevin Hilman <khilman@deeprootsystems.com>
Subject: [PM-WIP-OPP] [PATCH 1/2] omap3:pm:srf: check if pointer results with IS_ERR
Date: Tue, 16 Feb 2010 02:27:16 -0600	[thread overview]
Message-ID: <1266308837-23262-2-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1266308837-23262-1-git-send-email-nm@ti.com>

if we dont check the pointer returns with IS_ERR, we could
continue on with an error value as a valid pointer..

Cc: Ambresh K <ambresh@ti.com>
Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/resource34xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c
index 3604a38..ecc3c68 100644
--- a/arch/arm/mach-omap2/resource34xx.c
+++ b/arch/arm/mach-omap2/resource34xx.c
@@ -177,7 +177,7 @@ static int __deprecated opp_to_freq(unsigned long *freq, enum opp_t opp_type,
 	BUG_ON(!freq || opp_type >= OPP_TYPES_MAX);
 
 	opp = opp_find_by_opp_id(opp_type, opp_id);
-	if (!opp)
+	if (IS_ERR(opp))
 		return -EINVAL;
 
 	*freq = opp_get_freq(opp);
-- 
1.6.3.3


  reply	other threads:[~2010-02-16  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16  8:27 [PM-WIP-OPP] [PATCH 0/2] cleanups for pointer handling Nishanth Menon
2010-02-16  8:27 ` Nishanth Menon [this message]
2010-02-16  8:27   ` [PM-WIP-OPP] [PATCH 2/2] omap: opp: return error pointers if inactive opp layer Nishanth Menon
2010-02-23 18:36 ` [PM-WIP-OPP] [PATCH 0/2] cleanups for pointer handling Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266308837-23262-2-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=ambresh@ti.com \
    --cc=eduardo.valentin@nokia.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox