Skip to content

Commit

Permalink
[PATCH] v9fs: Twalk memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Latchesar Ionkov authored and Linus Torvalds committed May 15, 2006
1 parent 3dc7b82 commit 343f1fe
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions fs/9p/fcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit 343f1fe

Please sign in to comment.