btrfs: clear bio reference after submit_one_bio()
[muen/linux.git] / fs / btrfs / extent_io.c
index dab8af4450e16bd76a2bafaf3462c883e7ff8037..a7f66009519a9fb19cebf491d47b53f5a73a67ab 100644 (file)
@@ -2817,8 +2817,10 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,
                    bio_add_page(bio, page, page_size, offset) < page_size) {
                        ret = submit_one_bio(rw, bio, mirror_num,
                                             prev_bio_flags);
-                       if (ret < 0)
+                       if (ret < 0) {
+                               *bio_ret = NULL;
                                return ret;
+                       }
                        bio = NULL;
                } else {
                        return 0;