Staging: bcm: PHSModule.c: Replaced nested if statements with logical AND concatenati...
authorMatthias Beyer <mail@beyermatthias.de>
Tue, 15 Jul 2014 07:42:58 +0000 (09:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Jul 2014 15:09:48 +0000 (08:09 -0700)
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>
drivers/staging/bcm/PHSModule.c

index 55421efafb9b7ce3636730b5f00a93fc7b929227..89cc90c4bfbeb14001b2970904f119c7394f6cce 100644 (file)
@@ -519,19 +519,19 @@ ULONG PhsDeletePHSRule(IN void *pvContext,
                if (pstClassifierRulesTable) {
                        for (nClsidIndex = 0; nClsidIndex < MAX_PHSRULE_PER_SF; nClsidIndex++) {
                                curr_entry = &pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex];
-                               if (curr_entry->bUsed && curr_entry->pstPhsRule) {
-                                       if (curr_entry->pstPhsRule->u8PHSI == u8PHSI) {
+                               if (curr_entry->bUsed &&
+                                   curr_entry->pstPhsRule &&
+                                   (curr_entry->pstPhsRule->u8PHSI == u8PHSI)) {
 
-                                               if (curr_entry->pstPhsRule->u8RefCnt)
-                                                       curr_entry->pstPhsRule->u8RefCnt--;
+                                       if (curr_entry->pstPhsRule->u8RefCnt)
+                                               curr_entry->pstPhsRule->u8RefCnt--;
 
-                                               if (0 == curr_entry->pstPhsRule->u8RefCnt)
-                                                       kfree(curr_entry->pstPhsRule);
+                                       if (0 == curr_entry->pstPhsRule->u8RefCnt)
+                                               kfree(curr_entry->pstPhsRule);
 
-                                               memset(curr_entry,
-                                                      0,
-                                                      sizeof(struct bcm_phs_classifier_entry));
-                                       }
+                                       memset(curr_entry,
+                                              0,
+                                              sizeof(struct bcm_phs_classifier_entry));
                                }
                        }
                }