From 51bf6bb424c14bfd3590a0de03fbd07fc800435e Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 3 Dec 2009 09:46:31 +0000 Subject: [PATCH] bnx2: Protect tx timeout reset with rtnl_lock(). To prevent race conditions with other reset events. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/bnx2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 4cae2a86e741..03eb51f1c694 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -6263,8 +6263,11 @@ bnx2_reset_task(struct work_struct *work) { struct bnx2 *bp = container_of(work, struct bnx2, reset_task); - if (!netif_running(bp->dev)) + rtnl_lock(); + if (!netif_running(bp->dev)) { + rtnl_unlock(); return; + } bnx2_netif_stop(bp); @@ -6272,6 +6275,7 @@ bnx2_reset_task(struct work_struct *work) atomic_set(&bp->intr_sem, 1); bnx2_netif_start(bp); + rtnl_unlock(); } static void