ceph: fix invalid point dereference for error case in mdsc destroy
authorChengguang Xu <cgxu519@gmx.com>
Wed, 14 Mar 2018 05:47:33 +0000 (13:47 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 2 Apr 2018 08:12:49 +0000 (10:12 +0200)
commit50c55aeca27f09ceda0cd58b72b0addeecef74eb
tree58598250a7a96fca1ecc48d90bdead6a5a5e5fae
parent98cfda81040f4a6925a98567d036a918e855d4ec
ceph: fix invalid point dereference for error case in mdsc destroy

1. set fsc->mdsc after successfully allocate all necessary memory
in mdsc init.
2. if fsc->mdsc is NULL, just skip destroy operation in mdsc destroy.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c