DSPBRIDGE: unrelated fixes
cover DSPBRIDGE: unrelated fixes
A couple of unrelated fixes.
Omar Ramirez Luna (2):
DSPBRIDGE: logic error fix for SleepDSP timeout value
DSPBRIDGE: check pointer before dereference
drivers/dsp/bridge/pmgr/msg.c | 16 ++++++++-------- drivers/dsp/bridge/wmd/tiomap3430_pwr.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
PATCH 1/2 DSPBRIDGE: logic error fix for SleepDSP timeout value
When leaving the loop waiting for the dsp to transition from its power state, timeout value will be negative, therefore a print for "timeout waiting for the dsp" won't be displayed, as the condition to check for is !timeout.
--- drivers/dsp/bridge/wmd/tiomap3430_pwr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +1 -1
@@ -239,7 +239,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd, &pwrState);/* Wait for DSP to move into target power state */ -while ((pwrState != targetPwrState) && timeout--) { +while ((pwrState != targetPwrState) && --timeout) {if (msleep_interruptible (10 )) {pr_err ("Waiting for DSP to Suspend interrupted\n" );return DSP_EFAIL ;
Signature · 1 line
1.6.2.4
PATCH 2/2 DSPBRIDGE: check pointer before dereference
Change the check for valid handle to detect a possible error, and now use it before dereferencing the pointer.
--- drivers/dsp/bridge/pmgr/msg.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/dsp/bridge/pmgr/msg.c +8 -8
@@ -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); + } }/*
Signature · 1 line
1.6.2.4
Re: [PATCH 2/2] DSPBRIDGE: check pointer before dereference
Quoted 8 lines · Omar
Change the check for valid handle to detect a possible error, and now use it before dereferencing the pointer.
Signed-off-by Omar Ramirez Luna<[email protected]>--- drivers/dsp/bridge/pmgr/msg.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
Rebased and pushed to dspbridge
- omar
Omar Ramirez Luna
AppliedRe: [PATCH 1/2] DSPBRIDGE: logic error fix for SleepDSP timeout value
In reply to Omar Ramirez LunaQuoted 11 lines · Omar
When leaving the loop waiting for the dsp to transition from its power state, timeout value will be negative, therefore a print for "timeout waiting for the dsp" won't be displayed, as the condition to check for is !timeout.
Reported-by Berenice Herrera<[email protected]>Signed-off-by Omar Ramirez Luna<[email protected]>--- drivers/dsp/bridge/wmd/tiomap3430_pwr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Pushed to dspbridge
- omar