diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 6c325efa1c4e..f92c7dc9d9bf 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -435,8 +435,11 @@ static int ceph_init_request(struct netfs_io_request *rreq, struct file *file) rreq->netfs_priv = priv; out: - if (ret < 0) + if (ret < 0) { + if (got) + ceph_put_cap_refs(ceph_inode(inode), got); kfree(priv); + } return ret; }