[PATCH] DSPBRIDGE: Fix error handling in NODE_GetUUIDProps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Seth Forshee <seth.forshee@xxxxxxxxx>

The error handling is ineffective and can lead to an oops.

Acked-by: Ameya Palande <ameya.palande@xxxxxxxxx>
Signed-off-by: Seth Forshee <seth.forshee@xxxxxxxxx>
---
 drivers/dsp/bridge/rmgr/node.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
index 357d1cf..243e14b 100644
--- a/drivers/dsp/bridge/rmgr/node.c
+++ b/drivers/dsp/bridge/rmgr/node.c
@@ -3285,16 +3285,23 @@ DSP_STATUS NODE_GetUUIDProps(DSP_HPROCESSOR hProcessor,
 		 pNodeId, pNodeProps);
 
 	status = PROC_GetDevObject(hProcessor, &hDevObject);
-	if (DSP_SUCCEEDED(status)) {
-		status = DEV_GetNodeManager(hDevObject, &hNodeMgr);
-		if (hNodeMgr == NULL)
-			status = DSP_EFAIL;
+	if (DSP_FAILED(status))
+		goto func_end;
+
+	status = DEV_GetNodeManager(hDevObject, &hNodeMgr);
+	if (DSP_FAILED(status))
+		goto func_end;
+	if (hNodeMgr == NULL) {
+		status = DSP_EFAIL;
+		goto func_end;
 	}
 
-	/*  Enter the critical section.  This is needed because
-	* DCD_GetObjectDef will ultimately end up calling DBLL_open/close,
-	* which needs to be protected in order to not corrupt the zlib manager
-	* (COD). */
+	/*
+	 * Enter the critical section. This is needed because
+	 * DCD_GetObjectDef will ultimately end up calling DBLL_open/close,
+	 * which needs to be protected in order to not corrupt the zlib manager
+	 * (COD).
+	 */
 	status = SYNC_EnterCS(hNodeMgr->hSync);
 
 	if (DSP_SUCCEEDED(status)) {
@@ -3323,9 +3330,8 @@ DSP_STATUS NODE_GetUUIDProps(DSP_HPROCESSOR hProcessor,
 		}
 		/*  Leave the critical section, we're done.  */
 		(void)SYNC_LeaveCS(hNodeMgr->hSync);
-
 	}
-
+func_end:
 	return status;
 }
 
-- 
1.5.6.3

--
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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux