summaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-06-10 04:23:50 +0200
committerDavid S. Miller <davem@davemloft.net>2009-06-11 11:47:19 +0200
commit934037bc2ed29a94bbde72aa6a2e66bdc5861b98 (patch)
tree45104a213708003c341a3b10d3c9cb9b4503adea /drivers/net/benet
parentbe2net: Fix early reset of rx-completion (diff)
downloadlinux-934037bc2ed29a94bbde72aa6a2e66bdc5861b98.tar.xz
linux-934037bc2ed29a94bbde72aa6a2e66bdc5861b98.zip
be2net: Fix be_tx_q_clean() being called on freed queues
In the tx queue destroy path, be_tx_q_clean() is currently called after the tx queues are freed; it must be called before. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 86f70af93d60..66bb56874d9b 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1056,8 +1056,13 @@ static void be_tx_queues_destroy(struct be_adapter *adapter)
struct be_queue_info *q;
q = &adapter->tx_obj.q;
- if (q->created)
+ if (q->created) {
be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_TXQ);
+
+ /* No more tx completions can be rcvd now; clean up if there
+ * are any pending completions or pending tx requests */
+ be_tx_q_clean(adapter);
+ }
be_queue_free(adapter, q);
q = &adapter->tx_obj.cq;
@@ -1065,10 +1070,6 @@ static void be_tx_queues_destroy(struct be_adapter *adapter)
be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_CQ);
be_queue_free(adapter, q);
- /* No more tx completions can be rcvd now; clean up if there are
- * any pending completions or pending tx requests */
- be_tx_q_clean(adapter);
-
q = &adapter->tx_eq.q;
if (q->created)
be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_EQ);