From 2d5fb616bf6db1352dc28cfc903bd33f8858f458 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 22 Mar 2017 21:03:34 +0100 Subject: [PATCH] librbd: potential use of uninitialised value in ImageWatcher Signed-off-by: Mykola Golub --- src/librbd/ImageWatcher.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 8219201d1d5..18b55a0c070 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -651,7 +651,7 @@ bool ImageWatcher::handle_payload(const FlattenPayload &payload, ProgressContext *prog_ctx; r = prepare_async_request(payload.async_request_id, &new_request, &ctx, &prog_ctx); - if (new_request) { + if (r == 0 && new_request) { ldout(m_image_ctx.cct, 10) << this << " remote flatten request: " << payload.async_request_id << dendl; m_image_ctx.operations->execute_flatten(*prog_ctx, ctx); @@ -677,7 +677,7 @@ bool ImageWatcher::handle_payload(const ResizePayload &payload, ProgressContext *prog_ctx; r = prepare_async_request(payload.async_request_id, &new_request, &ctx, &prog_ctx); - if (new_request) { + if (r == 0 && new_request) { ldout(m_image_ctx.cct, 10) << this << " remote resize request: " << payload.async_request_id << " " << payload.size << " " @@ -812,7 +812,7 @@ bool ImageWatcher::handle_payload(const RebuildObjectMapPayload& payload, ProgressContext *prog_ctx; r = prepare_async_request(payload.async_request_id, &new_request, &ctx, &prog_ctx); - if (new_request) { + if (r == 0 && new_request) { ldout(m_image_ctx.cct, 10) << this << " remote rebuild object map request: " << payload.async_request_id << dendl;