From: Seth Forshee Date: Tue, 31 May 2011 21:35:50 +0000 (-0500) Subject: hfsplus: add missing call to bio_put() X-Git-Tag: v2.6.39.3~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e7c4a283602594b4b74ab636493665531a04e6e;p=thirdparty%2Fkernel%2Fstable.git hfsplus: add missing call to bio_put() commit 50176ddefa4a942419cb693dd2d8345bfdcde67c upstream. 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 Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index 3031d81f5f0f5..4ac88ff79aa66 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -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; @@ -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)