Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bnx2: Protect tx timeout reset with rtnl_lock().

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>

authored by

Michael Chan and committed by
David S. Miller
51bf6bb4 cceea982

+5 -1
+5 -1
drivers/net/bnx2.c
··· 6263 6263 { 6264 6264 struct bnx2 *bp = container_of(work, struct bnx2, reset_task); 6265 6265 6266 - if (!netif_running(bp->dev)) 6266 + rtnl_lock(); 6267 + if (!netif_running(bp->dev)) { 6268 + rtnl_unlock(); 6267 6269 return; 6270 + } 6268 6271 6269 6272 bnx2_netif_stop(bp); 6270 6273 ··· 6275 6272 6276 6273 atomic_set(&bp->intr_sem, 1); 6277 6274 bnx2_netif_start(bp); 6275 + rtnl_unlock(); 6278 6276 } 6279 6277 6280 6278 static void