]> git.hungrycats.org Git - linux/commitdiff
[PATCH] raid1: fix oops in bio_put()
authorAndrew Morton <akpm@osdl.org>
Mon, 1 Mar 2004 15:03:45 +0000 (07:03 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 1 Mar 2004 15:03:45 +0000 (07:03 -0800)
From: Neil Brown <neilb@cse.unsw.edu.au>

Fix an off-by-one in the r1buf_pool_alloc() ENOMEM error recovery path.

drivers/md/raid1.c

index 9da179f2975dc7384c4896e702075108163f2e70..f308d5fe946f4663cbe1f89dc9bfae1d53c221d7 100644 (file)
@@ -104,8 +104,8 @@ out_free_pages:
        for ( ; i > 0 ; i--)
                __free_page(bio->bi_io_vec[i-1].bv_page);
 out_free_bio:
-       while ( j < conf->raid_disks )
-               bio_put(r1_bio->bios[++j]);
+       while ( ++j < conf->raid_disks )
+               bio_put(r1_bio->bios[j]);
        r1bio_pool_free(r1_bio, conf->mddev);
        return NULL;
 }