mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
3dc7b82ea7
commit
343f1fe6f2
|
@ -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;
|
||||
if (rc)
|
||||
id = rc->id;
|
||||
|
||||
kfree(tc);
|
||||
|
||||
if (!rc)
|
||||
return;
|
||||
|
||||
v9ses = a;
|
||||
if (rc->id == RCLUNK)
|
||||
v9fs_put_idpool(fid, &v9ses->fidpool);
|
||||
|
||||
kfree(rc);
|
||||
if (id == RCLUNK) {
|
||||
v9ses = a;
|
||||
v9fs_put_idpool(fid, &v9ses->fidpool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue