diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2011-11-04 09:41:02 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-06 03:11:29 -0500 |
commit | 56d2a48f81a1bde827c625b90221fade72fe9c61 (patch) | |
tree | 162de09347589bc3bf9bd40f2c2ad6e32283798b /fs | |
parent | 21ca543efc12674fddb22ddf4ea4906427f4e982 (diff) |
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 <idryomov@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/scrub.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) | |||
655 | "scrub_fixup: btrfs_map_block failed us for %llu\n", | 655 | "scrub_fixup: btrfs_map_block failed us for %llu\n", |
656 | (unsigned long long)logical); | 656 | (unsigned long long)logical); |
657 | WARN_ON(1); | 657 | WARN_ON(1); |
658 | kfree(bbio); | ||
658 | return; | 659 | return; |
659 | } | 660 | } |
660 | 661 | ||