net/cxgbe: fix overlapping regions in TID table
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 14 Dec 2018 19:01:53 +0000 (00:31 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 21 Dec 2018 15:22:40 +0000 (16:22 +0100)
Location of filter TID table should be after active TID table memory,
and not from the beginning of TID table memory. This fixes memory
corruption due to overlapping regions.

Fixes: 3a381a4116ed ("net/cxgbe: query firmware for HASH filter resources")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/cxgbe_main.c

index 0368db5..5fa6cdd 100644 (file)
@@ -415,7 +415,7 @@ static int tid_init(struct tid_info *t)
                return -ENOMEM;
 
        t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids];
-       t->ftid_tab = (struct filter_entry *)&t->tid_tab[t->natids];
+       t->ftid_tab = (struct filter_entry *)&t->atid_tab[t->natids];
        t->ftid_bmap_array = t4_os_alloc(ftid_bmap_size);
        if (!t->ftid_bmap_array) {
                tid_free(t);