md/raid10: avoid memory leak on error path during reshape.
authorNeilBrown <neilb@suse.de>
Mon, 18 Aug 2014 04:48:54 +0000 (14:48 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 19 Aug 2014 07:20:27 +0000 (17:20 +1000)
If raid10 reshape fails to find somewhere to read a block
from, it returns without freeing memory...

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c

index a46124ecafc78b7e08f487834bcccc38ad663072..e5037e2aadd3078b7c6ca82b1b3fcd9c3cfbcfd3 100644 (file)
@@ -4399,6 +4399,7 @@ read_more:
                 * on all the target devices.
                 */
                // FIXME
+               mempool_free(r10_bio, conf->r10buf_pool);
                set_bit(MD_RECOVERY_INTR, &mddev->recovery);
                return sectors_done;
        }