From de1e3553605a91295d25d23e05371f5ff11c5f7e Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 22 May 2013 17:06:40 +0200 Subject: [PATCH] mds/Migrator.cc: fix possible NULL pointer dereference Move dout() calls behind the related asserts to prevent possible NULL pointer dereference. CID 717001 (#1 of 1): Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be null "diri" when calling "operator <<(std::ostream &, CInode Signed-off-by: Danny Al-Gaaf --- src/mds/Migrator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 565d45ddc97..f0deb7f8825 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -378,20 +378,20 @@ void Migrator::handle_mds_failure_or_stop(int who) break; case IMPORT_DISCOVERED: - dout(10) << "import state=discovered : unpinning inode " << *diri << dendl; assert(diri); + dout(10) << "import state=discovered : unpinning inode " << *diri << dendl; import_reverse_discovered(df, diri); break; case IMPORT_PREPPING: - dout(10) << "import state=prepping : unpinning base+bounds " << *dir << dendl; assert(dir); + dout(10) << "import state=prepping : unpinning base+bounds " << *dir << dendl; import_reverse_prepping(dir); break; case IMPORT_PREPPED: - dout(10) << "import state=prepped : unpinning base+bounds, unfreezing " << *dir << dendl; assert(dir); + dout(10) << "import state=prepped : unpinning base+bounds, unfreezing " << *dir << dendl; { set bounds; cache->get_subtree_bounds(dir, bounds);