提交 343f1fe6 编写于 作者: L Latchesar Ionkov 提交者: Linus Torvalds

[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: NLatchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@hera.kernel.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3dc7b82e
...@@ -98,23 +98,20 @@ v9fs_t_attach(struct v9fs_session_info *v9ses, char *uname, char *aname, ...@@ -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, static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc,
struct v9fs_fcall *rc, int err) struct v9fs_fcall *rc, int err)
{ {
int fid; int fid, id;
struct v9fs_session_info *v9ses; struct v9fs_session_info *v9ses;
if (err) id = 0;
return;
fid = tc->params.tclunk.fid; fid = tc->params.tclunk.fid;
kfree(tc); if (rc)
id = rc->id;
if (!rc)
return;
v9ses = a;
if (rc->id == RCLUNK)
v9fs_put_idpool(fid, &v9ses->fidpool);
kfree(tc);
kfree(rc); kfree(rc);
if (id == RCLUNK) {
v9ses = a;
v9fs_put_idpool(fid, &v9ses->fidpool);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册