diff mbox

myri10ge: fix rmmod crash

Message ID 20110323124412.GA7813@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Stanislaw Gruszka March 23, 2011, 12:44 p.m. UTC
Rmmod myri10ge crash at free_netdev() -> netif_napi_del(), because napi
structures are already deallocated. To fix call netif_napi_del() before
kfree() at myri10ge_free_slices().

Cc: stable@kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/myri10ge/myri10ge.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Andrew Gallatin March 23, 2011, 1:09 p.m. UTC | #1
On 03/23/11 08:44, Stanislaw Gruszka wrote:
> Rmmod myri10ge crash at free_netdev() ->  netif_napi_del(), because napi
> structures are already deallocated. To fix call netif_napi_del() before
> kfree() at myri10ge_free_slices().

I apologize; I made a similar fix myself to our tree last fall simply
forgot to post it to netdev... I'm terribly sorry for the time
you wasted chasing this.   At any rate...

Acked by: Andrew Gallatin <gallatin@myri.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 23, 2011, 7:31 p.m. UTC | #2
From: Andrew Gallatin <gallatin@myri.com>
Date: Wed, 23 Mar 2011 09:09:37 -0400

> On 03/23/11 08:44, Stanislaw Gruszka wrote:
>> Rmmod myri10ge crash at free_netdev() -> netif_napi_del(), because
>> napi
>> structures are already deallocated. To fix call netif_napi_del()
>> before
>> kfree() at myri10ge_free_slices().
> 
> I apologize; I made a similar fix myself to our tree last fall simply
> forgot to post it to netdev... I'm terribly sorry for the time
> you wasted chasing this.   At any rate...
> 
> Acked by: Andrew Gallatin <gallatin@myri.com>

Patch applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index ea5cfe2..24386a8 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -3645,6 +3645,7 @@  static void myri10ge_free_slices(struct myri10ge_priv *mgp)
 			dma_free_coherent(&pdev->dev, bytes,
 					  ss->fw_stats, ss->fw_stats_bus);
 			ss->fw_stats = NULL;
+			netif_napi_del(&ss->napi);
 		}
 	}
 	kfree(mgp->ss);