diff mbox

[1/8] dspbridge: Remove useless check

Message ID 1251375541-1866-2-git-send-email-andy.shevchenko@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Andy Shevchenko Aug. 27, 2009, 12:18 p.m. UTC
From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>

Before this check zlLib already dereferenced on one hand and DBC_Require()
checks for NULL on other hand.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
 drivers/dsp/bridge/pmgr/dbll.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

Comments

Guzman Lugo, Fernando Aug. 31, 2009, 8:12 p.m. UTC | #1
Hi,
	Looks good.

Acked-by: Fernando Guzman Lugo <x0095840@ti.com>


>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>owner@vger.kernel.org] On Behalf Of Andy Shevchenko
>Sent: Thursday, August 27, 2009 7:19 AM
>To: linux-omap@vger.kernel.org
>Cc: Andy Shevchenko
>Subject: [PATCH 1/8] dspbridge: Remove useless check
>
>From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
>
>Before this check zlLib already dereferenced on one hand and DBC_Require()
>checks for NULL on other hand.
>
>Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
>---
> drivers/dsp/bridge/pmgr/dbll.c |   34 ++++++++++++++++------------------
> 1 files changed, 16 insertions(+), 18 deletions(-)
>
>diff --git a/drivers/dsp/bridge/pmgr/dbll.c
>b/drivers/dsp/bridge/pmgr/dbll.c
>index 7c3cd40..e655f89 100644
>--- a/drivers/dsp/bridge/pmgr/dbll.c
>+++ b/drivers/dsp/bridge/pmgr/dbll.c
>@@ -909,26 +909,24 @@ void DBLL_unload(struct DBLL_LibraryObj *lib, struct
>DBLL_Attrs *attrs)
> 		goto func_end;
>
> 	zlLib->pTarget->attrs = *attrs;
>-	if (zlLib != NULL) {
>-		if (zlLib->mHandle) {
>-			err = Dynamic_Unload_Module(zlLib->mHandle,
>-				&zlLib->symbol.dlSymbol,
>-				&zlLib->allocate.dlAlloc, &zlLib->init.dlInit);
>-			if (err != 0) {
>-				GT_1trace(DBLL_debugMask, GT_5CLASS,
>-					 "Dynamic_Unload_Module "
>-					 "failed: 0x%x\n", err);
>-			}
>-		}
>-		/* remove symbols from symbol table */
>-		if (zlLib->symTab != NULL) {
>-			GH_delete(zlLib->symTab);
>-			zlLib->symTab = NULL;
>+	if (zlLib->mHandle) {
>+		err = Dynamic_Unload_Module(zlLib->mHandle,
>+			&zlLib->symbol.dlSymbol,
>+			&zlLib->allocate.dlAlloc, &zlLib->init.dlInit);
>+		if (err != 0) {
>+			GT_1trace(DBLL_debugMask, GT_5CLASS,
>+				 "Dynamic_Unload_Module "
>+				 "failed: 0x%x\n", err);
> 		}
>-		/* delete DOFF desc since it holds *lots* of host OS
>-		 * resources */
>-		dofClose(zlLib);
> 	}
>+	/* remove symbols from symbol table */
>+	if (zlLib->symTab != NULL) {
>+		GH_delete(zlLib->symTab);
>+		zlLib->symTab = NULL;
>+	}
>+	/* delete DOFF desc since it holds *lots* of host OS
>+	 * resources */
>+	dofClose(zlLib);
> func_end:
> 	DBC_Ensure(zlLib->loadRef >= 0);
> }
>--
>1.5.6.5
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

Patch

diff --git a/drivers/dsp/bridge/pmgr/dbll.c b/drivers/dsp/bridge/pmgr/dbll.c
index 7c3cd40..e655f89 100644
--- a/drivers/dsp/bridge/pmgr/dbll.c
+++ b/drivers/dsp/bridge/pmgr/dbll.c
@@ -909,26 +909,24 @@  void DBLL_unload(struct DBLL_LibraryObj *lib, struct DBLL_Attrs *attrs)
 		goto func_end;
 
 	zlLib->pTarget->attrs = *attrs;
-	if (zlLib != NULL) {
-		if (zlLib->mHandle) {
-			err = Dynamic_Unload_Module(zlLib->mHandle,
-				&zlLib->symbol.dlSymbol,
-				&zlLib->allocate.dlAlloc, &zlLib->init.dlInit);
-			if (err != 0) {
-				GT_1trace(DBLL_debugMask, GT_5CLASS,
-					 "Dynamic_Unload_Module "
-					 "failed: 0x%x\n", err);
-			}
-		}
-		/* remove symbols from symbol table */
-		if (zlLib->symTab != NULL) {
-			GH_delete(zlLib->symTab);
-			zlLib->symTab = NULL;
+	if (zlLib->mHandle) {
+		err = Dynamic_Unload_Module(zlLib->mHandle,
+			&zlLib->symbol.dlSymbol,
+			&zlLib->allocate.dlAlloc, &zlLib->init.dlInit);
+		if (err != 0) {
+			GT_1trace(DBLL_debugMask, GT_5CLASS,
+				 "Dynamic_Unload_Module "
+				 "failed: 0x%x\n", err);
 		}
-		/* delete DOFF desc since it holds *lots* of host OS
-		 * resources */
-		dofClose(zlLib);
 	}
+	/* remove symbols from symbol table */
+	if (zlLib->symTab != NULL) {
+		GH_delete(zlLib->symTab);
+		zlLib->symTab = NULL;
+	}
+	/* delete DOFF desc since it holds *lots* of host OS
+	 * resources */
+	dofClose(zlLib);
 func_end:
 	DBC_Ensure(zlLib->loadRef >= 0);
 }