rbd: fix a couple warnings
authorSage Weil <sage@inktank.com>
Sun, 9 Jun 2013 15:40:39 +0000 (08:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2014 20:24:25 +0000 (12:24 -0800)
commit e976cad0f0dbe5440a4ca38e29e1f932d9319125 upstream.

gcc isn't quite smart enough and generates these warnings:

drivers/block/rbd.c: In function 'rbd_img_request_fill':
drivers/block/rbd.c:1266:22: warning: 'bio_list' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/block/rbd.c:2186:14: note: 'bio_list' was declared here
drivers/block/rbd.c:2247:10: warning: 'pages' may be used uninitialized in this function [-Wmaybe-uninitialized]

even though they are initialized for their respective code paths.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/rbd.c

index 8326b39b0576974a1a4f12e646ce208ef1313790..10c45e101c97f4ae3426d0aa5cd33af7c635c231 100644 (file)
@@ -2173,9 +2173,9 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
        struct rbd_obj_request *obj_request = NULL;
        struct rbd_obj_request *next_obj_request;
        bool write_request = img_request_write_test(img_request);
-       struct bio *bio_list;
+       struct bio *bio_list = 0;
        unsigned int bio_offset = 0;
-       struct page **pages;
+       struct page **pages = 0;
        u64 img_offset;
        u64 resid;
        u16 opcode;