Skip to content

Commit

Permalink
bnx2: Protect tx timeout reset with rtnl_lock().
Browse files Browse the repository at this point in the history
To prevent race conditions with other reset events.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Dec 3, 2009
1 parent cceea98 commit 51bf6bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6263,15 +6263,19 @@ 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);

bnx2_init_nic(bp, 1);

atomic_set(&bp->intr_sem, 1);
bnx2_netif_start(bp);
rtnl_unlock();
}

static void
Expand Down

0 comments on commit 51bf6bb

Please sign in to comment.