netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH 5/5] be2net: Fix be_tx_q_clean() being called on freed queues
@ 2009-06-10 12:23 Sathya Perla
  2009-06-11  9:50 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sathya Perla @ 2009-06-10 12:23 UTC (permalink / raw)
  To: netdev

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>
---
 drivers/net/benet/be_main.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 86f70af..66bb568 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);
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net-next PATCH 5/5] be2net: Fix be_tx_q_clean() being called on freed queues
  2009-06-10 12:23 [net-next PATCH 5/5] be2net: Fix be_tx_q_clean() being called on freed queues Sathya Perla
@ 2009-06-11  9:50 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-06-11  9:50 UTC (permalink / raw)
  To: sathyap; +Cc: netdev

From: Sathya Perla <sathyap@serverengines.com>
Date: Wed, 10 Jun 2009 17:53:50 +0530

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-11  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-10 12:23 [net-next PATCH 5/5] be2net: Fix be_tx_q_clean() being called on freed queues Sathya Perla
2009-06-11  9:50 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).