Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 343f1fe6 authored by Latchesar Ionkov's avatar Latchesar Ionkov Committed by Linus Torvalds
Browse files

[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: default avatarLatchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@hera.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3dc7b82e
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -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;
	if (rc)
		id = rc->id;

	kfree(tc);
	kfree(rc);
	if (id == RCLUNK) {
		v9ses = a;
	if (rc->id == RCLUNK)
		v9fs_put_idpool(fid, &v9ses->fidpool);

	kfree(rc);
	}
}

/**