Skip to content

Commit

Permalink
Btrfs: fix a potential btrfs_bio leak on scrub fixups
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilya Dryomov authored and Chris Mason committed Nov 6, 2011
1 parent 21ca543 commit 56d2a48
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 56d2a48

Please sign in to comment.