From patchwork Thu Feb 18 21:55:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 80454 X-Patchwork-Delegate: omar.ramirez@ti.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 o1ILgvDO015847 for ; Thu, 18 Feb 2010 21:42:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755850Ab0BRVm4 (ORCPT ); Thu, 18 Feb 2010 16:42:56 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:55630 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753950Ab0BRVm4 (ORCPT ); Thu, 18 Feb 2010 16:42:56 -0500 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1ILgrue007060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 15:42:53 -0600 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 o1ILgqmG026397; Thu, 18 Feb 2010 15:42:53 -0600 (CST) Received: from Matrix (matrix.am.dhcp.ti.com [128.247.75.166]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o1ILgqZ21385; Thu, 18 Feb 2010 15:42:52 -0600 (CST) Received: by Matrix (Postfix, from userid 1003) id DADD4410601; Thu, 18 Feb 2010 15:55:34 -0600 (CST) From: Omar Ramirez Luna To: linux-omap Cc: Ameya Palande , Hiroshi Doyu , Felipe Contreras , Nishanth Menon , Omar Ramirez Luna Subject: [PATCH 2/2] DSPBRIDGE: check pointer before dereference Date: Thu, 18 Feb 2010 15:55:34 -0600 Message-Id: <1266530134-8186-3-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1266530134-8186-2-git-send-email-omar.ramirez@ti.com> References: <1266530134-8186-1-git-send-email-omar.ramirez@ti.com> <1266530134-8186-2-git-send-email-omar.ramirez@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]); Thu, 18 Feb 2010 21:42:57 +0000 (UTC) diff --git a/drivers/dsp/bridge/pmgr/msg.c b/drivers/dsp/bridge/pmgr/msg.c index 5cfeb5b..9e4b202 100644 --- a/drivers/dsp/bridge/pmgr/msg.c +++ b/drivers/dsp/bridge/pmgr/msg.c @@ -104,19 +104,19 @@ void MSG_Delete(struct MSG_MGR *hMsgMgr) struct WMD_DRV_INTERFACE *pIntfFxns; DBC_Require(cRefs > 0); - DBC_Require(MEM_IsValidHandle(pMsgMgr, MSGMGR_SIGNATURE)); GT_1trace(MSG_debugMask, GT_ENTER, "MSG_Delete: hMsgMgr: 0x%x\n", hMsgMgr); - pIntfFxns = pMsgMgr->pIntfFxns; + if (MEM_IsValidHandle(pMsgMgr, MSGMGR_SIGNATURE)) { + pIntfFxns = pMsgMgr->pIntfFxns; - /* Let WMD message module destroy the MSG_MGR: */ - (*pIntfFxns->pfnMsgDelete)(hMsgMgr); - - if (MEM_IsValidHandle(pMsgMgr, MSGMGR_SIGNATURE)) - GT_1trace(MSG_debugMask, GT_7CLASS, "MSG_Delete: Error hMsgMgr " - "Valid Handle: 0x%x\n", hMsgMgr); + /* Let WMD message module destroy the MSG_MGR: */ + (*pIntfFxns->pfnMsgDelete)(hMsgMgr); + } else { + GT_1trace(MSG_debugMask, GT_7CLASS, "MSG_Delete: Error hMsgMgr" + "invalid Handle: 0x%x\n", hMsgMgr); + } } /*