infra: fix potential infinite brick_wait (robustness)

This commit is contained in:
Thomas Schoebel-Theuer 2012-12-20 16:29:26 +01:00 committed by Thomas Schoebel-Theuer
parent 4154a8669c
commit 9bb6ef8a78
1 changed files with 4 additions and 2 deletions

View File

@ -24,9 +24,11 @@ int _brick_msleep(int msecs, bool shorten)
timeout = schedule_timeout_interruptible(timeout);
if (!shorten)
while (timeout)
if (!shorten) {
while ((long)timeout > 0) {
timeout = schedule_timeout_uninterruptible(timeout);
}
}
return jiffies_to_msecs(timeout);
}