Skip to content

Commit e976cad

Browse files
author
Sage Weil
committed
rbd: fix a couple warnings
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 <[email protected]>
1 parent 667ca05 commit e976cad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/rbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,9 +2163,9 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
21632163
struct rbd_obj_request *obj_request = NULL;
21642164
struct rbd_obj_request *next_obj_request;
21652165
bool write_request = img_request_write_test(img_request);
2166-
struct bio *bio_list;
2166+
struct bio *bio_list = 0;
21672167
unsigned int bio_offset = 0;
2168-
struct page **pages;
2168+
struct page **pages = 0;
21692169
u64 img_offset;
21702170
u64 resid;
21712171
u16 opcode;

0 commit comments

Comments
 (0)