Skip to content

Commit

Permalink
be2net: Fix be_tx_q_clean() being called on freed queues
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sathya Perla authored and David S. Miller committed Jun 11, 2009
1 parent a7a0ef3 commit 934037b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,19 +1056,20 @@ 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;
if (q->created)
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);
Expand Down

0 comments on commit 934037b

Please sign in to comment.