]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: Uninitialized variable used handle_refresh() 16724/head
authoramitkuma <amitkuma@redhat.com>
Tue, 1 Aug 2017 15:22:17 +0000 (20:52 +0530)
committeramitkuma <amitkuma@redhat.com>
Tue, 1 Aug 2017 15:22:17 +0000 (20:52 +0530)
Fixed:

** CID 1403249 (#1 of 1): Uninitialized scalar variable (UNINIT)
6. uninit_use: Using uninitialized value snap_protected.

Signed-off-by: Amit Kumar amitkuma@redhat.com
src/librbd/image/CloneRequest.cc

index 412d79c41b47bf6d636dbc26c8e0dd453e56019c..3753b94f85f95f160b681466b919b6686da34f7a 100644 (file)
@@ -316,7 +316,7 @@ template <typename I>
 void CloneRequest<I>::handle_refresh(int r) {
   ldout(m_cct, 20) << this << " " << __func__ << " r=" << r << dendl;
 
-  bool snap_protected;
+  bool snap_protected = false;
   if (r == 0) {
     m_p_imctx->snap_lock.get_read();
     r = m_p_imctx->is_snap_protected(m_p_imctx->snap_id, &snap_protected);