From: Sage Weil Date: Mon, 15 Mar 2010 18:01:50 +0000 (-0700) Subject: mds: avoid null deref of SimpleLock::_unstable X-Git-Tag: v0.20~275^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7af73ac84b3f9a1b1101ecc5c5a6d34e44df9f6b;p=ceph.git mds: avoid null deref of SimpleLock::_unstable --- diff --git a/src/mds/SimpleLock.h b/src/mds/SimpleLock.h index 084cd1f33a33..6479b28455ab 100644 --- a/src/mds/SimpleLock.h +++ b/src/mds/SimpleLock.h @@ -181,12 +181,14 @@ private: return _unstable; } void clear_more() { - assert(_unstable->empty()); - delete _unstable; - _unstable = NULL; + if (_unstable) { + assert(_unstable->empty()); + delete _unstable; + _unstable = NULL; + } } void try_clear_more() { - if (_unstable->empty()) { + if (_unstable && _unstable->empty()) { delete _unstable; _unstable = NULL; }