Netdev List
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>
Subject: [PATCH net-next v1 1/2] amd-xgbe: Free channel/ring structures later
Date: Thu, 6 Nov 2014 17:02:13 -0600	[thread overview]
Message-ID: <20141106230213.21973.14781.stgit@tlendack-t1.amdoffice.net> (raw)
In-Reply-To: <20141106230207.21973.67338.stgit@tlendack-t1.amdoffice.net>

The channel structure is freed before freeing the per channel
interrupts resulting in a kernel oops. Move the call to free
the channel structure to after the freeing of the per channel
interrupts.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index ced9f52..ec5fff3 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -1369,9 +1369,6 @@ static int xgbe_close(struct net_device *netdev)
 	/* Free the ring descriptors and buffers */
 	desc_if->free_ring_resources(pdata);
 
-	/* Free the channel and ring structures */
-	xgbe_free_channels(pdata);
-
 	/* Release the interrupts */
 	devm_free_irq(pdata->dev, pdata->dev_irq, pdata);
 	if (pdata->per_channel_irq) {
@@ -1380,6 +1377,9 @@ static int xgbe_close(struct net_device *netdev)
 			devm_free_irq(pdata->dev, channel->dma_irq, channel);
 	}
 
+	/* Free the channel and ring structures */
+	xgbe_free_channels(pdata);
+
 	/* Disable the clocks */
 	clk_disable_unprepare(pdata->ptpclk);
 	clk_disable_unprepare(pdata->sysclk);

  reply	other threads:[~2014-11-06 23:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 23:02 [PATCH net-next v1 0/2] amd-xgbe: AMD XGBE driver updates 2014-11-06 Tom Lendacky
2014-11-06 23:02 ` Tom Lendacky [this message]
2014-11-06 23:02 ` [PATCH net-next v1 2/2] amd-xgbe: Check for complete packet on skb allocation error Tom Lendacky
2014-11-07  0:00 ` [PATCH net-next v1 0/2] amd-xgbe: AMD XGBE driver updates 2014-11-06 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141106230213.21973.14781.stgit@tlendack-t1.amdoffice.net \
    --to=thomas.lendacky@amd.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox