summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLatchesar Ionkov <lucho@ionkov.net>2006-05-15 09:44:18 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-15 11:20:56 -0700
commit343f1fe6f2e3fb4912db241e639b0721c2e14f2e (patch)
tree80f5c857ff7d4cd162c7d3fc0b23abc348de9559 /fs
parent3dc7b82ea7649356bf027fba50c16ca50cec31e2 (diff)
downloadop-kernel-dev-343f1fe6f2e3fb4912db241e639b0721c2e14f2e.zip
op-kernel-dev-343f1fe6f2e3fb4912db241e639b0721c2e14f2e.tar.gz
[PATCH] v9fs: Twalk memory leak
v9fs leaks memory if the file server responds with Rerror to a Twalk message. The patch fixes the leak. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Cc: Eric Van Hensbergen <ericvh@hera.kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/fcall.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/9p/fcall.c b/fs/9p/fcall.c
index 71742ba1..6f26178 100644
--- a/fs/9p/fcall.c
+++ b/fs/9p/fcall.c
@@ -98,23 +98,20 @@ v9fs_t_attach(struct v9fs_session_info *v9ses, char *uname, char *aname,
static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc,
struct v9fs_fcall *rc, int err)
{
- int fid;
+ int fid, id;
struct v9fs_session_info *v9ses;
- if (err)
- return;
-
+ id = 0;
fid = tc->params.tclunk.fid;
- kfree(tc);
-
- if (!rc)
- return;
-
- v9ses = a;
- if (rc->id == RCLUNK)
- v9fs_put_idpool(fid, &v9ses->fidpool);
+ if (rc)
+ id = rc->id;
+ kfree(tc);
kfree(rc);
+ if (id == RCLUNK) {
+ v9ses = a;
+ v9fs_put_idpool(fid, &v9ses->fidpool);
+ }
}
/**
OpenPOWER on IntegriCloud