From: Andy Shevchenko <[email protected]>

In case of NULL return DSP_EMEMORY status instead of DSP_SOK.

Signed-off-by: Andy Shevchenko <[email protected]>
---
 drivers/dsp/bridge/rmgr/drv.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv.c b/drivers/dsp/bridge/rmgr/drv.c
index 691c727..bedc34c 100644
--- a/drivers/dsp/bridge/rmgr/drv.c
+++ b/drivers/dsp/bridge/rmgr/drv.c
@@ -1571,17 +1571,18 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, 
s32 bRequest)
                /* Releasing resources by deleting the registry key  */
                dwBuffSize = sizeof(struct CFG_HOSTRES);
                pResources = MEM_Calloc(dwBuffSize, MEM_NONPAGED);
-               if (DSP_FAILED(REG_GetValue(NULL, (char *)driverExt->szString,
-                  CURRENTCONFIG, (u8 *)pResources, &dwBuffSize))) {
-                       status = CFG_E_RESOURCENOTAVAIL;
-                       GT_0trace(curTrace, GT_1CLASS,
-                                "REG_GetValue Failed \n");
-               } else {
-                       GT_0trace(curTrace, GT_1CLASS,
-                                "REG_GetValue Succeeded \n");
-               }
-
                if (pResources != NULL) {
+                       if (DSP_FAILED(REG_GetValue(NULL,
+                           (char *) driverExt->szString,
+                           CURRENTCONFIG, (u8 *) pResources, &dwBuffSize))) {
+                               status = CFG_E_RESOURCENOTAVAIL;
+                               GT_0trace(curTrace, GT_1CLASS,
+                                        "REG_GetValue Failed \n");
+                       } else {
+                               GT_0trace(curTrace, GT_1CLASS,
+                                        "REG_GetValue Succeeded \n");
+                       }
+
                        dwBuffSize = sizeof(shm_size);
                        status = REG_GetValue(NULL, CURRENTCONFIG, SHMSIZE,
                                (u8 *)&shm_size, &dwBuffSize);
@@ -1646,6 +1647,8 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, 
s32 bRequest)
                                 (u32)dwBuffSize);
                        /*  Set all the other entries to NULL */
                        MEM_Free(pResources);
+               } else {
+                       status = DSP_EMEMORY;
                }
                GT_0trace(curTrace, GT_ENTER, " <- RequestBridgeResources \n");
                return status;
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to