From patchwork Mon Mar 23 18:49:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kanigeri, Hari" X-Patchwork-Id: 13807 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2NIo46M026458 for ; Mon, 23 Mar 2009 18:50:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751972AbZCWSt2 (ORCPT ); Mon, 23 Mar 2009 14:49:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753698AbZCWSt2 (ORCPT ); Mon, 23 Mar 2009 14:49:28 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:42921 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbZCWSt1 (ORCPT ); Mon, 23 Mar 2009 14:49:27 -0400 Received: from dlep95.itg.ti.com ([157.170.170.107]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n2NInLQ0018531 for ; Mon, 23 Mar 2009 13:49:26 -0500 Received: from dlee75.ent.ti.com (localhost [127.0.0.1]) by dlep95.itg.ti.com (8.13.8/8.13.8) with ESMTP id n2NInLKM027051 for ; Mon, 23 Mar 2009 13:49:21 -0500 (CDT) Received: from dlee03.ent.ti.com ([157.170.170.18]) by dlee75.ent.ti.com ([157.170.170.72]) with mapi; Mon, 23 Mar 2009 13:49:21 -0500 From: "Kanigeri, Hari" To: "linux-omap@vger.kernel.org" Date: Mon, 23 Mar 2009 13:49:19 -0500 Subject: [PATCH] [OMAPZOOM]DSPBRIDGE bug in Bridge exit cleanup Thread-Topic: [PATCH] [OMAPZOOM]DSPBRIDGE bug in Bridge exit cleanup Thread-Index: Acmr6BM18BJBh1pxS8i5e+utnLzXGw== Message-ID: <8F7AF80515AF0D4D93307E594F3CB40E2342BE9F@dlee03.ent.ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The Bridge exit resource cleanup is accessing Process context pointer after it is freed. Fixed this by holding the next Process context pointer in a temporary variable. Signed-off-by: Hari Kanigeri --- drivers/dsp/bridge/rmgr/drv_interface.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index a756997..af98600 100644 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -537,7 +537,7 @@ static void __exit bridge_exit(void) DSP_STATUS dsp_status = DSP_SOK; HANDLE hDrvObject = NULL; struct PROCESS_CONTEXT *pCtxtclosed = NULL; - + struct PROCESS_CONTEXT *pTmp = NULL; GT_0trace(driverTrace, GT_ENTER, "-> driver_exit\n"); @@ -551,9 +551,10 @@ static void __exit bridge_exit(void) "process***%d\n", pCtxtclosed->pid); DRV_RemoveAllResources(pCtxtclosed); PROC_Detach(pCtxtclosed->hProcessor); + pTmp = pCtxtclosed->next; DRV_RemoveProcContext((struct DRV_OBJECT *)hDrvObject, pCtxtclosed, (void *)pCtxtclosed->pid); - pCtxtclosed = pCtxtclosed->next;; + pCtxtclosed = pTmp; } func_cont: #ifndef CONFIG_DISABLE_BRIDGE_PM