diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 662ada467c32..5daf86621871 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1469,7 +1469,7 @@ out: if (psession) { *psession = session; - } else { + } else if (session) { mutex_unlock(&session->s_mutex); ceph_put_mds_session(session); }