From: runsisi Date: Thu, 21 Apr 2016 06:48:55 +0000 (+0800) Subject: librbd: fix potential double free of SetSnapRequest instance X-Git-Tag: v11.0.0~880^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a6eaac12fe29762c3dd29068f9427840cfea100;p=ceph.git librbd: fix potential double free of SetSnapRequest instance if image feature EXCLUSIVE_LOCK is not enabled we should not try to initialize the exclusive lock, or we may end with two async Contexts to finish the same SetSnapRequest instance Fixes: http://tracker.ceph.com/issues/15571 Signed-off-by: runsisi --- diff --git a/src/librbd/image/SetSnapRequest.cc b/src/librbd/image/SetSnapRequest.cc index ca10e457959e..f30f4a97fe75 100644 --- a/src/librbd/image/SetSnapRequest.cc +++ b/src/librbd/image/SetSnapRequest.cc @@ -60,8 +60,8 @@ void SetSnapRequest::send_init_exclusive_lock() { int r = 0; if (send_refresh_parent(&r) != nullptr) { send_complete(); - return; } + return; } CephContext *cct = m_image_ctx.cct;