diff options
| author | Matthias Beyer <[email protected]> | 2014-07-15 09:43:06 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2014-07-15 08:09:48 -0700 |
| commit | c8020cc93e53ea9fcc5df56e09b70e002e5812ce (patch) | |
| tree | ae67ddb134478f4f273f91bf984285f026ce19cc | |
| parent | 3ed150a178a86c249f06024690b2924c48fd6e48 (diff) | |
Staging: bcm: PHSModule.c: Replaced indentation level with goto jump on bad condition
Signed-off-by: Matthias Beyer <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/staging/bcm/PHSModule.c | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/drivers/staging/bcm/PHSModule.c b/drivers/staging/bcm/PHSModule.c index d2aa9c911d17..c2901788cc0a 100644 --- a/drivers/staging/bcm/PHSModule.c +++ b/drivers/staging/bcm/PHSModule.c @@ -895,50 +895,53 @@ static void free_phs_serviceflow_rules(struct bcm_phs_table *psServiceFlowRulesT BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL, "=======>\n"); - if (psServiceFlowRulesTable) { - for (i = 0; i < MAX_SERVICEFLOWS; i++) { - struct bcm_phs_entry stServiceFlowEntry = - psServiceFlowRulesTable->stSFList[i]; - struct bcm_phs_classifier_table *pstClassifierRulesTable = - stServiceFlowEntry.pstClassifierTable; + if (!psServiceFlowRulesTable) + goto out; - if (pstClassifierRulesTable) { - for (j = 0; j < MAX_PHSRULE_PER_SF; j++) { - curr_act_rules_list = - &pstClassifierRulesTable->stActivePhsRulesList[j]; + for (i = 0; i < MAX_SERVICEFLOWS; i++) { + struct bcm_phs_entry stServiceFlowEntry = + psServiceFlowRulesTable->stSFList[i]; + struct bcm_phs_classifier_table *pstClassifierRulesTable = + stServiceFlowEntry.pstClassifierTable; - curr_old_rules_list = - &pstClassifierRulesTable->stOldPhsRulesList[j]; + if (pstClassifierRulesTable) { + for (j = 0; j < MAX_PHSRULE_PER_SF; j++) { + curr_act_rules_list = + &pstClassifierRulesTable->stActivePhsRulesList[j]; - if (curr_act_rules_list->pstPhsRule) { + curr_old_rules_list = + &pstClassifierRulesTable->stOldPhsRulesList[j]; - if (curr_act_rules_list->pstPhsRule->u8RefCnt) - curr_act_rules_list->pstPhsRule->u8RefCnt--; + if (curr_act_rules_list->pstPhsRule) { - if (0 == curr_act_rules_list->pstPhsRule->u8RefCnt) - kfree(curr_act_rules_list->pstPhsRule); + if (curr_act_rules_list->pstPhsRule->u8RefCnt) + curr_act_rules_list->pstPhsRule->u8RefCnt--; - curr_act_rules_list->pstPhsRule = NULL; - } + if (0 == curr_act_rules_list->pstPhsRule->u8RefCnt) + kfree(curr_act_rules_list->pstPhsRule); - if (curr_old_rules_list->pstPhsRule) { + curr_act_rules_list->pstPhsRule = NULL; + } - if (curr_old_rules_list->pstPhsRule->u8RefCnt) - curr_old_rules_list->pstPhsRule->u8RefCnt--; + if (curr_old_rules_list->pstPhsRule) { - if (0 == curr_old_rules_list->pstPhsRule->u8RefCnt) - kfree(curr_old_rules_list->pstPhsRule); + if (curr_old_rules_list->pstPhsRule->u8RefCnt) + curr_old_rules_list->pstPhsRule->u8RefCnt--; - curr_old_rules_list->pstPhsRule = NULL; - } + if (0 == curr_old_rules_list->pstPhsRule->u8RefCnt) + kfree(curr_old_rules_list->pstPhsRule); + + curr_old_rules_list->pstPhsRule = NULL; } - kfree(pstClassifierRulesTable); - stServiceFlowEntry.pstClassifierTable = - pstClassifierRulesTable = NULL; } + kfree(pstClassifierRulesTable); + stServiceFlowEntry.pstClassifierTable = + pstClassifierRulesTable = NULL; } } +out: + kfree(psServiceFlowRulesTable); psServiceFlowRulesTable = NULL; } |