summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarian Chereji <marian.chereji@freescale.com>2013-09-04 08:39:23 (GMT)
committerRivera Jose-B46482 <German.Rivera@freescale.com>2013-09-27 19:58:12 (GMT)
commit1c0997b604759faa2741e3e5e518f87edf80fed0 (patch)
tree01c17687c7492b61129536622c16095bd4d959db /drivers
parent1dae7fa3b2b222d23d0f2d78f8be712572bdb3a4 (diff)
downloadlinux-fsl-qoriq-1c0997b604759faa2741e3e5e518f87edf80fed0.tar.xz
dpa_offload: Fix static index initialization in DPA Classifier
The static indexes used in recursive functions "init_hm_chain" and "remove_hm_chain" were not initialized. Also, "remove_hm_chain" was not decrementing this index as it removed header manipulations. Signed-off-by: Marian Chereji <marian.chereji@freescale.com> Change-Id: I00bd44c00749578a4c785741082e0ad2c1076c27 Reviewed-on: http://git.am.freescale.net:8181/4412 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Bulie Radu-Andrei-B37577 <Radu.Bulie@freescale.com> Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/fsl_dpa_offload/dpa_classifier.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier.c b/drivers/staging/fsl_dpa_offload/dpa_classifier.c
index f8ed8b7..751dacd 100644
--- a/drivers/staging/fsl_dpa_offload/dpa_classifier.c
+++ b/drivers/staging/fsl_dpa_offload/dpa_classifier.c
@@ -3585,7 +3585,7 @@ static int init_hm_chain(void *fm_pcd, struct list_head *chain_head,
t_Error error;
struct dpa_cls_hm_node *pcurrent, *pnext;
t_FmPcdManipParams params;
- static int index;
+ static int index = 0;
static int num_int_nodes;
BUG_ON(!chain_head);
@@ -3798,7 +3798,7 @@ int remove_hm_chain(struct list_head *chain_head, struct list_head *item)
int err = 0;
struct dpa_cls_hm_node *pcurrent;
t_Error error;
- static int index;
+ static int index = 0;
BUG_ON(!chain_head);
BUG_ON(!item);
@@ -3829,6 +3829,8 @@ int remove_hm_chain(struct list_head *chain_head, struct list_head *item)
remove_hm_node(pcurrent);
+ index--;
+
return err;
}