[PATCH 5.15 418/476] ceph: prevent use-after-free in encode_cap_msg()