]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-fuse.c: init 'rbd' in open_rbd_image()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 8 May 2014 14:04:18 +0000 (16:04 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 8 May 2014 14:04:18 +0000 (16:04 +0200)
commit0d01563f8b51dd47c878436ed61e4e63e09f5bda
tree969922f8a09caf99e6404bcbb8595d17a28c6ff8
parentcfc885fa56e528b38e90a6304b2ac1f5770a44cc
rbd-fuse.c: init 'rbd' in open_rbd_image()

Init 'rbd' in open_rbd_image() with NULL and add a check for
'rbd' before dereference it to fix:

rbd_fuse/rbd-fuse.c:182:29: warning: variable 'rbd' may be uninitialized
 when used here [-Wconditional-uninitialized]
        int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
                                  ^~~
rbd_fuse/rbd-fuse.c:151:27: note: initialize the variable 'rbd' to silence
 this warning
        struct rbd_openimage *rbd;
                                 ^
                                  = NULL

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rbd_fuse/rbd-fuse.c