X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Flguest%2Flguest_user.c;h=2221485b07739a48114f44dc38b4f4249a93360c;hb=2bf86b7aa8e74bf81a9872f7b610f49b610a4649;hp=85d42d3d01a9a9bbeb739ce422271848cd4be3ff;hpb=70ec75c5b8e0bda7a16fb387f91e08545f379a0e;p=mv-sheeva.git diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index 85d42d3d01a..2221485b077 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c @@ -241,15 +241,16 @@ static ssize_t write(struct file *file, const char __user *in, cpu = &lg->cpus[cpu_id]; if (!cpu) return -EINVAL; - } - /* Once the Guest is dead, all you can do is read() why it died. */ - if (lg && lg->dead) - return -ENOENT; + /* Once the Guest is dead, you can only read() why it died. */ + if (lg->dead) + return -ENOENT; - /* If you're not the task which owns the Guest, you can only break */ - if (lg && current != cpu->tsk && req != LHREQ_BREAK) - return -EPERM; + /* If you're not the task which owns the Guest, all you can do + * is break the Launcher out of running the Guest. */ + if (current != cpu->tsk && req != LHREQ_BREAK) + return -EPERM; + } switch (req) { case LHREQ_INITIALIZE: