summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2005-07-28 21:12:58 +0200
committerDavid S. Miller <davem@davemloft.net>2005-07-28 21:12:58 +0200
commit6192b54b845ed05cb838f86ca588cc625c703a09 (patch)
treeb78a56cb70fe36f145821ac3c699abf3dc627256 /net
parentRevert broken "statement with no effect" warning fix (diff)
downloadlinux-6192b54b845ed05cb838f86ca588cc625c703a09.tar.xz
linux-6192b54b845ed05cb838f86ca588cc625c703a09.zip
[NET]: Fix busy waiting in dev_close().
If the current task has signal_pending(), the loop we have to wait for the __LINK_STATE_RX_SCHED bit to clear becomes a pure busy-loop. Fixed by using msleep() instead of the hand-crafted version. Noticed by Andrew Morton. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ff9dc029233a..52a3bf7ae177 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -901,8 +901,7 @@ int dev_close(struct net_device *dev)
smp_mb__after_clear_bit(); /* Commit netif_running(). */
while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
/* No hurry. */
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(1);
+ msleep(1);
}
/*