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 <ambr...@ti.com>
Cc: Eduardo Valentin <eduardo.valen...@nokia.com>
Cc: Kevin Hilman <khil...@deeprootsystems.com>

Signed-off-by: Nishanth Menon <n...@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

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

Reply via email to