Staging: bcm: PHSModule.c: Replaced indentation level with goto jump on bad condition
Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3ed150a178
commit
c8020cc93e
1 changed files with 35 additions and 32 deletions
|
@ -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,
|
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL,
|
||||||
"=======>\n");
|
"=======>\n");
|
||||||
|
|
||||||
if (psServiceFlowRulesTable) {
|
if (!psServiceFlowRulesTable)
|
||||||
for (i = 0; i < MAX_SERVICEFLOWS; i++) {
|
goto out;
|
||||||
struct bcm_phs_entry stServiceFlowEntry =
|
|
||||||
psServiceFlowRulesTable->stSFList[i];
|
|
||||||
struct bcm_phs_classifier_table *pstClassifierRulesTable =
|
|
||||||
stServiceFlowEntry.pstClassifierTable;
|
|
||||||
|
|
||||||
if (pstClassifierRulesTable) {
|
for (i = 0; i < MAX_SERVICEFLOWS; i++) {
|
||||||
for (j = 0; j < MAX_PHSRULE_PER_SF; j++) {
|
struct bcm_phs_entry stServiceFlowEntry =
|
||||||
curr_act_rules_list =
|
psServiceFlowRulesTable->stSFList[i];
|
||||||
&pstClassifierRulesTable->stActivePhsRulesList[j];
|
struct bcm_phs_classifier_table *pstClassifierRulesTable =
|
||||||
|
stServiceFlowEntry.pstClassifierTable;
|
||||||
|
|
||||||
curr_old_rules_list =
|
if (pstClassifierRulesTable) {
|
||||||
&pstClassifierRulesTable->stOldPhsRulesList[j];
|
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)
|
if (curr_act_rules_list->pstPhsRule) {
|
||||||
curr_act_rules_list->pstPhsRule->u8RefCnt--;
|
|
||||||
|
|
||||||
if (0 == curr_act_rules_list->pstPhsRule->u8RefCnt)
|
if (curr_act_rules_list->pstPhsRule->u8RefCnt)
|
||||||
kfree(curr_act_rules_list->pstPhsRule);
|
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)
|
if (curr_old_rules_list->pstPhsRule->u8RefCnt)
|
||||||
kfree(curr_old_rules_list->pstPhsRule);
|
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);
|
kfree(psServiceFlowRulesTable);
|
||||||
psServiceFlowRulesTable = NULL;
|
psServiceFlowRulesTable = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue