diff options
author | Dan Carpenter <error27@gmail.com> | 2010-10-08 16:56:35 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-08 18:29:55 +0400 |
commit | acedadfae589885e1753f8fc4eb0d797846861b9 (patch) | |
tree | 8bfa9b61883f26085dcdb49c0c75755cdaa303e5 /drivers/staging/bcm/CmHost.c | |
parent | 055a1eda5fe143fdb8137cfd6eee39c9b58fe72d (diff) | |
download | linux-acedadfae589885e1753f8fc4eb0d797846861b9.tar.xz |
Staging: bcm: dereferencing before checking
I moved the check to see if "Adapter" was null in front of the
dereference.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/CmHost.c')
-rw-r--r-- | drivers/staging/bcm/CmHost.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index 0329f7dc7140..b4113923e3ed 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); |