diff options
| author | Karol Swietlicki <magotari@gmail.com> | 2008-02-05 01:31:25 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:31 -0500 |
| commit | cc0be0fb3fd4bd2c363ef1b5c968cd6f2ce478cf (patch) | |
| tree | 19a4a1127fed020ec1c08264117517e49ddad0ea | |
| parent | ab26a5276c1b0945c3281a73b3a89d025906c880 (diff) | |
uml: fix infinite mconsole loop
This patch takes care of a problem with the stopping code.
The function inside the while condition returns 0 to signify a problem. A
problem could be for example a bad command or a bad version of the mconsole
client. A bad command would terminate the stopping loop and resume the
kernel. This is a problem.
A better solution is to make the loop infinite and don't leave it until we are
explicitly told to.
Signed-off-by: Karol Swietlicki <magotari@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | arch/um/drivers/mconsole_kern.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index c953e1477be4..949037e92a7b 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
| @@ -305,7 +305,9 @@ void mconsole_stop(struct mc_request *req) | |||
| 305 | deactivate_fd(req->originating_fd, MCONSOLE_IRQ); | 305 | deactivate_fd(req->originating_fd, MCONSOLE_IRQ); |
| 306 | os_set_fd_block(req->originating_fd, 1); | 306 | os_set_fd_block(req->originating_fd, 1); |
| 307 | mconsole_reply(req, "stopped", 0, 0); | 307 | mconsole_reply(req, "stopped", 0, 0); |
| 308 | while (mconsole_get_request(req->originating_fd, req)) { | 308 | for (;;) { |
| 309 | if (!mconsole_get_request(req->originating_fd, req)) | ||
| 310 | continue; | ||
| 309 | if (req->cmd->handler == mconsole_go) | 311 | if (req->cmd->handler == mconsole_go) |
| 310 | break; | 312 | break; |
| 311 | if (req->cmd->handler == mconsole_stop) { | 313 | if (req->cmd->handler == mconsole_stop) { |
