]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: assert non-null ptrs in OnFinisher
authorJohn Spray <john.spray@redhat.com>
Wed, 6 Aug 2014 11:27:13 +0000 (12:27 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:34:17 +0000 (01:34 +0100)
Callers should not be constructing C_OnFinisher
if they have no context to call back.

Signed-off-by: John Spray <john.spray@redhat.com>
src/common/Finisher.h

index 610470eb4e1268739d65ad8129636d4f3cea3000..229342079d8dbb1ef210634efe001efd05eb550e 100644 (file)
@@ -122,7 +122,10 @@ class C_OnFinisher : public Context {
   Context *con;
   Finisher *fin;
 public:
-  C_OnFinisher(Context *c, Finisher *f) : con(c), fin(f) {}
+  C_OnFinisher(Context *c, Finisher *f) : con(c), fin(f) {
+    assert(fin != NULL);
+    assert(con != NULL);
+  }
   void finish(int r) {
     fin->queue(con, r);
   }