Btrfs: fix use of uninitialized err variable
authorFilipe David Borba Manana <fdmanana@gmail.com>
Fri, 13 Dec 2013 19:39:34 +0000 (19:39 +0000)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:19:57 +0000 (13:19 -0800)
fs/btrfs/file.c: In function ‘prepare_pages.isra.18’:
fs/btrfs/file.c:1265:6: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file.c

index 740ae8c71701077de03396fc0c0bae377100ad4c..35bf83876f3fe51eae6f4769a89246981f10d1c9 100644 (file)
@@ -1244,7 +1244,7 @@ static noinline int prepare_pages(struct inode *inode, struct page **pages,
        int i;
        unsigned long index = pos >> PAGE_CACHE_SHIFT;
        gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping);
-       int err;
+       int err = 0;
        int faili;
 
        for (i = 0; i < num_pages; i++) {