Commit 88c380df authored by Raju Rangoju's avatar Raju Rangoju Committed by David S. Miller

cxgb4: avoid accessing registers when clearing filters

Hardware register having the server TID base can contain
invalid values when adapter is in bad state (for example,
due to AER fatal error). Reading these invalid values in the
register can lead to out-of-bound memory access. So, fix
by using the saved server TID base when clearing filters.

Fixes: b1a79360 ("cxgb4: Delete all hash and TCAM filters before resource cleanup")
Signed-off-by: default avatarRaju Rangoju <rajur@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be338bda
...@@ -1042,7 +1042,7 @@ void clear_all_filters(struct adapter *adapter) ...@@ -1042,7 +1042,7 @@ void clear_all_filters(struct adapter *adapter)
cxgb4_del_filter(dev, f->tid, &f->fs); cxgb4_del_filter(dev, f->tid, &f->fs);
} }
sb = t4_read_reg(adapter, LE_DB_SRVR_START_INDEX_A); sb = adapter->tids.stid_base;
for (i = 0; i < sb; i++) { for (i = 0; i < sb; i++) {
f = (struct filter_entry *)adapter->tids.tid_tab[i]; f = (struct filter_entry *)adapter->tids.tid_tab[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment