From: Andy Shevchenko <ext-andriy.shevchenko@xxxxxxxxx> Check input value before dereferencing it. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@xxxxxxxxx> --- drivers/dsp/bridge/wmd/tiomap3430.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c index db48c49..4cb78c7 100644 --- a/drivers/dsp/bridge/wmd/tiomap3430.c +++ b/drivers/dsp/bridge/wmd/tiomap3430.c @@ -1266,11 +1266,16 @@ static DSP_STATUS WMD_DEV_Destroy(struct WMD_DEV_CONTEXT *hDevContext) DSP_STATUS status = DSP_SOK; struct WMD_DEV_CONTEXT *pDevContext = (struct WMD_DEV_CONTEXT *) hDevContext; + + /* It should never happen */ + if (!hDevContext) + return DSP_EHANDLE; + DBG_Trace(DBG_ENTER, "Entering WMD_DEV_Destroy:n hDevContext ::0x%x\n", hDevContext); /* first put the device to stop state */ WMD_BRD_Delete(pDevContext); - if (pDevContext && pDevContext->pPtAttrs) { + if (pDevContext->pPtAttrs) { pPtAttrs = pDevContext->pPtAttrs; if (pPtAttrs->hCSObj) SYNC_DeleteCS(pPtAttrs->hCSObj); -- 1.5.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html