* [PATCH] v9fs: Twalk memory leak
@ 2006-05-06 19:14 Latchesar Ionkov
0 siblings, 0 replies; only message in thread
From: Latchesar Ionkov @ 2006-05-06 19:14 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
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>
---
commit d0ea523deb849227892c3359227219a260390dec
tree da70110e3a0691dd0a30d037b6456b9372c20f51
parent ebf34c9b6fcd22338ef764b039b3ac55ed0e297b
author Latchesar Ionkov <lucho@ionkov.net> Tue, 02 May 2006 16:42:24 -0600
committer Latchesar Ionkov <lucho@ionkov.net> Tue, 02 May 2006 16:42:24 -0600
fs/9p/fcall.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/fs/9p/fcall.c b/fs/9p/fcall.c
index 71742ba..6f26178 100644
--- a/fs/9p/fcall.c
+++ b/fs/9p/fcall.c
@@ -98,23 +98,20 @@ v9fs_t_attach(struct v9fs_session_info *
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);
+ }
}
/**
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-06 19:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-06 19:14 [PATCH] v9fs: Twalk memory leak Latchesar Ionkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox