Commit 2ad32cf0 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov
Browse files

ceph: fix memory leak on decode error in ceph_handle_caps



If we hit a decoding error late in the frame, then we might exit the
function without putting the pool_ns string. Ensure that we always put
that reference on the way out of the function.

Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 7d2a07b7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4134,8 +4134,9 @@ void ceph_handle_caps(struct ceph_mds_session *session,
done:
	mutex_unlock(&session->s_mutex);
done_unlocked:
	ceph_put_string(extra_info.pool_ns);
	iput(inode);
out:
	ceph_put_string(extra_info.pool_ns);
	return;

flush_cap_releases:
@@ -4150,7 +4151,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
bad:
	pr_err("ceph_handle_caps: corrupt message\n");
	ceph_msg_dump(msg);
	return;
	goto out;
}

/*