diff options
author | Kevin McKinney <klmckinney1@gmail.com> | 2012-02-23 23:41:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 11:53:10 -0800 |
commit | adc4a3a4b0b78a2ab910685d138e0e598fc0edc7 (patch) | |
tree | e3e4dab6bb4b529d7c1bbfa25c75d52856b58790 /drivers/staging/bcm | |
parent | eb6cfa5b74ae362f17a2ce43fe2caab3c98b4e70 (diff) | |
download | linux-adc4a3a4b0b78a2ab910685d138e0e598fc0edc7.tar.bz2 |
Staging: bcm: fix possible NULL dereference of psfLocalSet in CmHost.c
Variable psfLocalSet may not follow the correct
path in the code, and therefore may not be set
properly. As such, causing a null dereference.
Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/bcm')
-rw-r--r-- | drivers/staging/bcm/CmHost.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index 522d0052e839..e332f1e7c11e 100644 --- a/drivers/staging/bcm/CmHost.c +++ b/drivers/staging/bcm/CmHost.c @@ -1839,7 +1839,13 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /* <Pointer to the Adap Adapter->PackInfo[uiSearchRuleIndex].bActive = TRUE; } - if (psfLocalSet->bValid && (pstChangeIndication->u8CC == 0)) { + if (!psfLocalSet) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "No set is valid\n"); + Adapter->PackInfo[uiSearchRuleIndex].bActive = FALSE; + Adapter->PackInfo[uiSearchRuleIndex].bValid = FALSE; + Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0; + kfree(pstAddIndication); + } else if (psfLocalSet->bValid && (pstChangeIndication->u8CC == 0)) { Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = ntohs(pstChangeIndication->u16VCID); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "CC field is %d bvalid = %d\n", pstChangeIndication->u8CC, psfLocalSet->bValid); |