All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Staging: bcm: dereferencing before checking
@ 2010-10-08 12:56 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-10-08 12:56 UTC (permalink / raw)
  To: kernel-janitors

I moved the check to see if "Adapter" was null in front of the
dereference.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 37187c4..46f3a7d 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1943,15 +1943,14 @@ ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
 	ULONG ulIndex=0;
 	int Status;
 
+	if (!Adapter) {
+		BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!");
+		return 0;
+	}
+
 	if(Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
 		return 1;
 
-	 if(NULL = Adapter)
-	 {
-		 BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Adapter was NULL!!!");
-		 return 0;
-	 }
-
 	BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size of Each DSX Buffer(Also size of ServiceFlowParamSI): %zx ",sizeof(stServiceFlowParamSI));
 	BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Reading DSX buffer From Target location %x ",DSX_MESSAGE_EXCHANGE_BUFFER);
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-08 12:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08 12:56 [patch] Staging: bcm: dereferencing before checking Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.