diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid10.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index ec271ae4318f..fb9062b5022c 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -173,10 +173,11 @@ out_free_pages: | |||
173 | while (j--) | 173 | while (j--) |
174 | for (i = 0; i < RESYNC_PAGES ; i++) | 174 | for (i = 0; i < RESYNC_PAGES ; i++) |
175 | safe_put_page(r10_bio->devs[j].bio->bi_io_vec[i].bv_page); | 175 | safe_put_page(r10_bio->devs[j].bio->bi_io_vec[i].bv_page); |
176 | j = -1; | 176 | j = 0; |
177 | out_free_bio: | 177 | out_free_bio: |
178 | while (++j < nalloc) { | 178 | for ( ; j < nalloc; j++) { |
179 | bio_put(r10_bio->devs[j].bio); | 179 | if (r10_bio->devs[j].bio) |
180 | bio_put(r10_bio->devs[j].bio); | ||
180 | if (r10_bio->devs[j].repl_bio) | 181 | if (r10_bio->devs[j].repl_bio) |
181 | bio_put(r10_bio->devs[j].repl_bio); | 182 | bio_put(r10_bio->devs[j].repl_bio); |
182 | } | 183 | } |