aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-09-24 17:22:23 -0400
committerEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>2008-09-24 17:22:23 -0400
commitec3c68f232f6d98b4596c05c1c7551b44c617c5f (patch)
treed00aac0a2ff78d9d45a8247139543b942fc87595 /net
parent571ffeafffbfdd0b8f2f9d3b991028797ec87e42 (diff)
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')
-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 6c88e8983750..f6d4af16cb19 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)
1344{ 1344{
1345 int ret, n; 1345 int ret, n;
1346 struct p9_trans_fd *ts = NULL; 1346 struct p9_trans_fd *ts = NULL;
1347 mm_segment_t oldfs;
1348 1347
1349 if (trans && trans->status == Connected) 1348 if (trans && trans->status == Connected)
1350 ts = trans->priv; 1349 ts = trans->priv;
@@ -1358,24 +1357,17 @@ p9_fd_poll(struct p9_trans *trans, struct poll_table_struct *pt)
1358 if (!ts->wr->f_op || !ts->wr->f_op->poll) 1357 if (!ts->wr->f_op || !ts->wr->f_op->poll)
1359 return -EIO; 1358 return -EIO;
1360 1359
1361 oldfs = get_fs();
1362 set_fs(get_ds());
1363
1364 ret = ts->rd->f_op->poll(ts->rd, pt); 1360 ret = ts->rd->f_op->poll(ts->rd, pt);
1365 if (ret < 0) 1361 if (ret < 0)
1366 goto end; 1362 return ret;
1367 1363
1368 if (ts->rd != ts->wr) { 1364 if (ts->rd != ts->wr) {
1369 n = ts->wr->f_op->poll(ts->wr, pt); 1365 n = ts->wr->f_op->poll(ts->wr, pt);
1370 if (n < 0) { 1366 if (n < 0)
1371 ret = n; 1367 return n;
1372 goto end;
1373 }
1374 ret = (ret & ~POLLOUT) | (n & ~POLLIN); 1368 ret = (ret & ~POLLOUT) | (n & ~POLLIN);
1375 } 1369 }
1376 1370
1377end:
1378 set_fs(oldfs);
1379 return ret; 1371 return ret;
1380} 1372}
1381 1373