aboutsummaryrefslogtreecommitdiff
path: root/net/9p/trans_fd.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-09-24 16:22:23 -0500
committerEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>2008-09-24 16:22:23 -0500
commitec3c68f232f6d98b4596c05c1c7551b44c617c5f (patch)
treed00aac0a2ff78d9d45a8247139543b942fc87595 /net/9p/trans_fd.c
parent571ffeafffbfdd0b8f2f9d3b991028797ec87e42 (diff)
downloadlinux-2.6.38-lt-ux500-ec3c68f232f6d98b4596c05c1c7551b44c617c5f.tar.gz
9p-trans_fd: don't do fs segment mangling in p9_fd_poll()
p9_fd_poll() is never called with user pointers and f_op->poll() doesn't expect its arguments to be from userland. There's no need to set kernel ds before calling f_op->poll() from p9_fd_poll(). Remove it. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/trans_fd.c')
-rw-r--r--net/9p/trans_fd.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 6c88e898375..f6d4af16cb1 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -1344,7 +1344,6 @@ p9_fd_poll(struct p9_trans *trans, struct poll_table_struct *pt)
{
int ret, n;
struct p9_trans_fd *ts = NULL;
- mm_segment_t oldfs;
if (trans && trans->status == Connected)
ts = trans->priv;
@@ -1358,24 +1357,17 @@ p9_fd_poll(struct p9_trans *trans, struct poll_table_struct *pt)
if (!ts->wr->f_op || !ts->wr->f_op->poll)
return -EIO;
- oldfs = get_fs();
- set_fs(get_ds());
-
ret = ts->rd->f_op->poll(ts->rd, pt);
if (ret < 0)
- goto end;
+ return ret;
if (ts->rd != ts->wr) {
n = ts->wr->f_op->poll(ts->wr, pt);
- if (n < 0) {
- ret = n;
- goto end;
- }
+ if (n < 0)
+ return n;
ret = (ret & ~POLLOUT) | (n & ~POLLIN);
}
-end:
- set_fs(oldfs);
return ret;
}