Skip to content

Commit

Permalink
hfsplus: add missing call to bio_put()
Browse files Browse the repository at this point in the history
hfsplus leaks bio objects by failing to call bio_put() on the bios
it allocates. Add the missing call to fix the leak.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Cc: <stable@kernel.org> # .38.x, .39.x
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Seth Forshee authored and Christoph Hellwig committed Jun 30, 2011
1 parent ca56a95 commit 50176dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/hfsplus/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
{
DECLARE_COMPLETION_ONSTACK(wait);
struct bio *bio;
int ret = 0;

bio = bio_alloc(GFP_NOIO, 1);
bio->bi_sector = sector;
Expand All @@ -54,8 +55,10 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
wait_for_completion(&wait);

if (!bio_flagged(bio, BIO_UPTODATE))
return -EIO;
return 0;
ret = -EIO;

bio_put(bio);
return ret;
}

static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
Expand Down

0 comments on commit 50176dd

Please sign in to comment.