aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/bcm/PHSModule.c
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2014-07-15 09:43:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-15 08:09:48 -0700
commit3ed150a178a86c249f06024690b2924c48fd6e48 (patch)
treead9687d757972322d037021da208677c3f5646c8 /drivers/staging/bcm/PHSModule.c
parentStaging: bcm: PHSModule.c: Added missing braces around else block (diff)
downloadlinux-dev-3ed150a178a86c249f06024690b2924c48fd6e48.tar.xz
linux-dev-3ed150a178a86c249f06024690b2924c48fd6e48.zip
Staging: bcm: PHSModule.c: Replaced member accessing with variable in free_phs_service()
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>
Diffstat (limited to 'drivers/staging/bcm/PHSModule.c')
-rw-r--r--drivers/staging/bcm/PHSModule.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/staging/bcm/PHSModule.c b/drivers/staging/bcm/PHSModule.c
index e3db972d5b35..d2aa9c911d17 100644
--- a/drivers/staging/bcm/PHSModule.c
+++ b/drivers/staging/bcm/PHSModule.c
@@ -889,6 +889,8 @@ static void free_phs_serviceflow_rules(struct bcm_phs_table *psServiceFlowRulesT
{
int i, j;
struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
+ struct bcm_phs_classifier_entry *curr_act_rules_list;
+ struct bcm_phs_classifier_entry *curr_old_rules_list;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH, DBG_LVL_ALL,
"=======>\n");
@@ -902,26 +904,32 @@ static void free_phs_serviceflow_rules(struct bcm_phs_table *psServiceFlowRulesT
if (pstClassifierRulesTable) {
for (j = 0; j < MAX_PHSRULE_PER_SF; j++) {
- if (pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule) {
+ curr_act_rules_list =
+ &pstClassifierRulesTable->stActivePhsRulesList[j];
- if (pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule->u8RefCnt)
- pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule->u8RefCnt--;
+ curr_old_rules_list =
+ &pstClassifierRulesTable->stOldPhsRulesList[j];
- if (0 == pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule->u8RefCnt)
- kfree(pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule);
+ if (curr_act_rules_list->pstPhsRule) {
- pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule = NULL;
+ if (curr_act_rules_list->pstPhsRule->u8RefCnt)
+ curr_act_rules_list->pstPhsRule->u8RefCnt--;
+
+ if (0 == curr_act_rules_list->pstPhsRule->u8RefCnt)
+ kfree(curr_act_rules_list->pstPhsRule);
+
+ curr_act_rules_list->pstPhsRule = NULL;
}
- if (pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule) {
+ if (curr_old_rules_list->pstPhsRule) {
- if (pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule->u8RefCnt)
- pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule->u8RefCnt--;
+ if (curr_old_rules_list->pstPhsRule->u8RefCnt)
+ curr_old_rules_list->pstPhsRule->u8RefCnt--;
- if (0 == pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule->u8RefCnt)
- kfree(pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule);
+ if (0 == curr_old_rules_list->pstPhsRule->u8RefCnt)
+ kfree(curr_old_rules_list->pstPhsRule);
- pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule = NULL;
+ curr_old_rules_list->pstPhsRule = NULL;
}
}
kfree(pstClassifierRulesTable);