Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a984b124 authored by Matthias Beyer's avatar Matthias Beyer Committed by Greg Kroah-Hartman
Browse files

Staging: bcm: PHSModule.c: Replaced member accessing with variables

parent fc38bc1d
Loading
Loading
Loading
Loading
+24 −16
Original line number Original line Diff line number Diff line
@@ -635,6 +635,8 @@ ULONG PhsDeleteSFRules(IN void *pvContext, IN B_UINT16 uiVcid)
	struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
	struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
	struct bcm_phs_extension *pDeviceExtension =
	struct bcm_phs_extension *pDeviceExtension =
		(struct bcm_phs_extension *)pvContext;
		(struct bcm_phs_extension *)pvContext;
	struct bcm_phs_classifier_entry *curr_clsf_entry;
	struct bcm_phs_classifier_entry *curr_rules_list;


	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");
@@ -654,30 +656,36 @@ ULONG PhsDeleteSFRules(IN void *pvContext, IN B_UINT16 uiVcid)
	pstClassifierRulesTable = pstServiceFlowEntry->pstClassifierTable;
	pstClassifierRulesTable = pstServiceFlowEntry->pstClassifierTable;
	if (pstClassifierRulesTable) {
	if (pstClassifierRulesTable) {
		for (nClsidIndex = 0; nClsidIndex < MAX_PHSRULE_PER_SF; nClsidIndex++) {
		for (nClsidIndex = 0; nClsidIndex < MAX_PHSRULE_PER_SF; nClsidIndex++) {
			if (pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule) {
			curr_clsf_entry =
				&pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex];


				if (pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule->u8RefCnt)
			curr_rules_list =
					pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule->u8RefCnt--;
				&pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex];


				if (0 == pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule->u8RefCnt)
			if (curr_clsf_entry->pstPhsRule) {
					kfree(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule);


				pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule = NULL;
				if (curr_clsf_entry->pstPhsRule->u8RefCnt)
					curr_clsf_entry->pstPhsRule->u8RefCnt--;

				if (0 == curr_clsf_entry->pstPhsRule->u8RefCnt)
					kfree(curr_clsf_entry->pstPhsRule);

				curr_clsf_entry->pstPhsRule = NULL;
			}
			}
			memset(&pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex],
			memset(curr_clsf_entry, 0,
			       0, sizeof(struct bcm_phs_classifier_entry));
			       sizeof(struct bcm_phs_classifier_entry));
			if (pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule) {
			if (curr_rules_list->pstPhsRule) {


				if (pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule->u8RefCnt)
				if (curr_rules_list->pstPhsRule->u8RefCnt)
					pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule->u8RefCnt--;
					curr_rules_list->pstPhsRule->u8RefCnt--;


				if (0 == pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule->u8RefCnt)
				if (0 == curr_rules_list->pstPhsRule->u8RefCnt)
					kfree(pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule);
					kfree(curr_rules_list->pstPhsRule);


				pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule = NULL;
				curr_rules_list->pstPhsRule = NULL;
			}
			}
			memset(&pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex],
			memset(curr_rules_list, 0,
			       0, sizeof(struct bcm_phs_classifier_entry));
			       sizeof(struct bcm_phs_classifier_entry));
		}
		}
	}
	}
	pstServiceFlowEntry->bUsed = false;
	pstServiceFlowEntry->bUsed = false;