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

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
......@@ -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;
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment