]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ConfigKeyService.cc: move assert before first deref
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 18 Aug 2015 10:26:44 +0000 (12:26 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 10 Sep 2015 17:29:20 +0000 (19:29 +0200)
Fix for:

[src/mon/ConfigKeyService.cc:94] -> [src/mon/ConfigKeyService.cc:100]:
 (warning) Possible null pointer dereference: m - otherwise it is redundant
 to check it against null.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/ConfigKeyService.cc

index ba6408bd938938eb82648ea581b2604af3e43616..64ed42ffc883fc5f4f310ad2b7d29c1d2a0997ba 100644 (file)
@@ -91,13 +91,14 @@ void ConfigKeyService::store_list(stringstream &ss)
 bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
 {
   Message *m = op->get_req();
+  assert(m != NULL);
   dout(10) << __func__ << " " << *m << dendl;
+
   if (!in_quorum()) {
     dout(1) << __func__ << " not in quorum -- ignore message" << dendl;
     return false;
   }
 
-  assert(m != NULL);
   assert(m->get_type() == MSG_MON_COMMAND);
 
   MMonCommand *cmd = static_cast<MMonCommand*>(m);