diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 662ada467c3243da18a1fff96719795fe4f6244f..5daf86621871b921debd4e26772bca65ff8bac7d 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1469,7 +1469,7 @@ void ceph_flush_snaps(struct ceph_inode_info *ci, if (psession) { *psession = session; - } else { + } else if (session) { mutex_unlock(&session->s_mutex); ceph_put_mds_session(session); }