* [PATCH] DSPBRIDGE: Fix to avoid possible memory leaks in bridge driver.
@ 2010-01-28 18:27 Ramos Falcon, Ernesto
2010-02-06 1:57 ` Omar Ramirez Luna
0 siblings, 1 reply; 2+ messages in thread
From: Ramos Falcon, Ernesto @ 2010-01-28 18:27 UTC (permalink / raw)
To: linux-omap@vger.kernel.org
>From e586fe38099ac140e037fda9d2e7d3a846ec023c Mon Sep 17 00:00:00 2001
From: Ernesto Ramos <ernesto@ti.com>
Date: Thu, 28 Jan 2010 12:11:39 -0600
Subject: [PATCH] DSPBRIDGE: Fix to avoid possible memory leaks in bridge driver.
This patch fixes possible memory leaks detected in dsp bridge.
Signed-off-by: Ernesto Ramos <ernesto@ti.com>
---
drivers/dsp/bridge/pmgr/dbll.c | 3 ++-
drivers/dsp/bridge/rmgr/drv.c | 4 ++--
drivers/dsp/bridge/wmd/msg_sm.c | 8 ++------
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/dsp/bridge/pmgr/dbll.c b/drivers/dsp/bridge/pmgr/dbll.c
index 5422d21..fab749e 100644
--- a/drivers/dsp/bridge/pmgr/dbll.c
+++ b/drivers/dsp/bridge/pmgr/dbll.c
@@ -1347,13 +1347,14 @@ static int rmmAlloc(struct Dynamic_Loader_Allocate *this,
req, segId);
}
}
+func_cont:
MEM_Free(szSectName);
szSectName = NULL;
MEM_Free(szLastToken);
szLastToken = NULL;
MEM_Free(szSecLastToken);
szSecLastToken = NULL;
-func_cont:
+
if (memType == DBLL_CODE)
allocSize = info->size + GEM_L1P_PREFETCH_SIZE;
else
diff --git a/drivers/dsp/bridge/rmgr/drv.c b/drivers/dsp/bridge/rmgr/drv.c
index c69e3af..373bd26 100644
--- a/drivers/dsp/bridge/rmgr/drv.c
+++ b/drivers/dsp/bridge/rmgr/drv.c
@@ -616,7 +616,6 @@ DSP_STATUS DRV_Create(OUT struct DRV_OBJECT **phDRVObject)
status = DSP_EFAIL;
GT_0trace(curTrace, GT_7CLASS,
"Failed to Create DRV_EXT list ");
- MEM_FreeObject(pDRVObject);
} else {
INIT_LIST_HEAD(&pDRVObject->devNodeString->
head);
@@ -626,7 +625,6 @@ DSP_STATUS DRV_Create(OUT struct DRV_OBJECT **phDRVObject)
status = DSP_EMEMORY;
GT_0trace(curTrace, GT_7CLASS,
"Failed to Create Dev List ");
- MEM_FreeObject(pDRVObject);
}
} else {
status = DSP_EMEMORY;
@@ -642,6 +640,8 @@ DSP_STATUS DRV_Create(OUT struct DRV_OBJECT **phDRVObject)
pDRVObject);
*phDRVObject = pDRVObject;
} else {
+ MEM_Free(pDRVObject->devList);
+ MEM_Free(pDRVObject->devNodeString);
/* Free the DRV Object */
MEM_Free(pDRVObject);
GT_0trace(curTrace, GT_7CLASS,
diff --git a/drivers/dsp/bridge/wmd/msg_sm.c b/drivers/dsp/bridge/wmd/msg_sm.c
index 50201e5..974d266 100644
--- a/drivers/dsp/bridge/wmd/msg_sm.c
+++ b/drivers/dsp/bridge/wmd/msg_sm.c
@@ -129,8 +129,8 @@ DSP_STATUS WMD_MSG_CreateQueue(struct MSG_MGR *hMsgMgr,
DSP_STATUS status = DSP_SOK;
if (!MEM_IsValidHandle(hMsgMgr, MSGMGR_SIGNATURE) ||
- phMsgQueue == NULL) {
- status = DSP_EMEMORY;
+ phMsgQueue == NULL || !hMsgMgr->msgFreeList) {
+ status = DSP_EHANDLE;
goto func_end;
}
@@ -177,10 +177,6 @@ DSP_STATUS WMD_MSG_CreateQueue(struct MSG_MGR *hMsgMgr,
status = SYNC_OpenEvent(&pMsgQ->hSyncDoneAck, NULL);
if (DSP_SUCCEEDED(status)) {
- if (!hMsgMgr->msgFreeList) {
- status = DSP_EHANDLE;
- goto func_end;
- }
/* Enter critical section */
(void)SYNC_EnterCS(hMsgMgr->hSyncCS);
/* Initialize message frames and put in appropriate queues */
--
1.5.4.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] DSPBRIDGE: Fix to avoid possible memory leaks in bridge driver.
2010-01-28 18:27 [PATCH] DSPBRIDGE: Fix to avoid possible memory leaks in bridge driver Ramos Falcon, Ernesto
@ 2010-02-06 1:57 ` Omar Ramirez Luna
0 siblings, 0 replies; 2+ messages in thread
From: Omar Ramirez Luna @ 2010-02-06 1:57 UTC (permalink / raw)
To: Ramos Falcon, Ernesto; +Cc: linux-omap@vger.kernel.org
On 1/28/2010 12:27 PM, Ramos Falcon, Ernesto wrote:
> From e586fe38099ac140e037fda9d2e7d3a846ec023c Mon Sep 17 00:00:00 2001
> From: Ernesto Ramos<ernesto@ti.com>
> Date: Thu, 28 Jan 2010 12:11:39 -0600
> Subject: [PATCH] DSPBRIDGE: Fix to avoid possible memory leaks in bridge driver.
>
> This patch fixes possible memory leaks detected in dsp bridge.
>
> Signed-off-by: Ernesto Ramos<ernesto@ti.com>
Acked-by: Omar Ramirez Luna <omar.ramirez@ti.com>
> ---
> drivers/dsp/bridge/pmgr/dbll.c | 3 ++-
> drivers/dsp/bridge/rmgr/drv.c | 4 ++--
> drivers/dsp/bridge/wmd/msg_sm.c | 8 ++------
> 3 files changed, 6 insertions(+), 9 deletions(-)
>
Pushed to dspbridge.
- omar
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-06 1:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 18:27 [PATCH] DSPBRIDGE: Fix to avoid possible memory leaks in bridge driver Ramos Falcon, Ernesto
2010-02-06 1:57 ` Omar Ramirez Luna
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox