Skip to content

Commit

Permalink
Staging: bcm: fix possible NULL dereference of psfLocalSet in CmHost.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin McKinney authored and Greg Kroah-Hartman committed Feb 24, 2012
1 parent eb6cfa5 commit adc4a3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/staging/bcm/CmHost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit adc4a3a

Please sign in to comment.