From: Ilya Dryomov Date: Fri, 4 Nov 2011 13:41:02 +0000 (-0400) Subject: Btrfs: fix a potential btrfs_bio leak on scrub fixups X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=56d2a48f81a1bde827c625b90221fade72fe9c61;p=linux-beck.git Btrfs: fix a potential btrfs_bio leak on scrub fixups In case we were able to map less than we wanted (length < PAGE_SIZE clause is true) btrfs_bio is still allocated and we have to free it. Signed-off-by: Ilya Dryomov Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 562dad10dee9..ed11d3866afd 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -655,6 +655,7 @@ static void scrub_fixup(struct scrub_bio *sbio, int ix) "scrub_fixup: btrfs_map_block failed us for %llu\n", (unsigned long long)logical); WARN_ON(1); + kfree(bbio); return; }