ceph: fix NULL pointer dereference in ceph_flush_snaps()
authorYan, Zheng <zyan@redhat.com>
Mon, 28 Aug 2017 07:02:42 +0000 (15:02 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 6 Sep 2017 17:56:52 +0000 (19:56 +0200)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 662ada467c3243da18a1fff96719795fe4f6244f..5daf86621871b921debd4e26772bca65ff8bac7d 100644 (file)
@@ -1469,7 +1469,7 @@ out:
 
        if (psession) {
                *psession = session;
-       } else {
+       } else if (session) {
                mutex_unlock(&session->s_mutex);
                ceph_put_mds_session(session);
        }