From patchwork Mon May 17 20:11:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 100212 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4HKBxKR009907 for ; Mon, 17 May 2010 20:11:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754700Ab0EQUL6 (ORCPT ); Mon, 17 May 2010 16:11:58 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58096 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043Ab0EQUL5 (ORCPT ); Mon, 17 May 2010 16:11:57 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o4HKBUSq011512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 May 2010 15:11:32 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o4HKBSqv029300; Mon, 17 May 2010 15:11:28 -0500 (CDT) Received: from senorita (senorita.am.dhcp.ti.com [128.247.75.1]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o4HKBRP08045; Mon, 17 May 2010 15:11:27 -0500 (CDT) Received: by senorita (Postfix, from userid 1000) id ACD85C242; Mon, 17 May 2010 15:11:27 -0500 (CDT) From: Nishanth Menon To: linux-omap Cc: Nishanth Menon , Eduardo Valentin , Jouni Hogander , Kevin Hilman , Paul Walmsley , Rajendra Nayak , Sanjeev Premi , Tero Kristo , Tony Lindgren , Vishwanath BS Subject: [PM][PATCH 1/2] omap: opp: make opp_get_opp_id robust Date: Mon, 17 May 2010 15:11:21 -0500 Message-Id: <1274127082-16288-2-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1274127082-16288-1-git-send-email-nm@ti.com> References: <1274127082-16288-1-git-send-email-nm@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 17 May 2010 20:11:59 +0000 (UTC) diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c index 229960d..0b61325 100644 --- a/arch/arm/plat-omap/opp.c +++ b/arch/arm/plat-omap/opp.c @@ -101,6 +101,10 @@ struct omap_opp * __deprecated opp_find_by_opp_id(enum opp_t opp_type, u8 __deprecated opp_get_opp_id(struct omap_opp *opp) { + if (unlikely(!opp || IS_ERR(opp)) || !opp->enabled) { + pr_err("%s: Invalid parameter being passed\n", __func__); + return 0; + } return opp->opp_id; }