From: John Spray Date: Wed, 6 Aug 2014 11:27:13 +0000 (+0100) Subject: common: assert non-null ptrs in OnFinisher X-Git-Tag: v0.86~213^2~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=04d01eb37b7f04fbd185577cc912cb3265b0fa63;p=ceph.git common: assert non-null ptrs in OnFinisher Callers should not be constructing C_OnFinisher if they have no context to call back. Signed-off-by: John Spray --- diff --git a/src/common/Finisher.h b/src/common/Finisher.h index 610470eb4e12..229342079d8d 100644 --- a/src/common/Finisher.h +++ b/src/common/Finisher.h @@ -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); }