mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
hfsplus: add missing call to bio_put()
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>
This commit is contained in:
parent
ca56a95eed
commit
50176ddefa
@ -36,6 +36,7 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
|
|||||||
{
|
{
|
||||||
DECLARE_COMPLETION_ONSTACK(wait);
|
DECLARE_COMPLETION_ONSTACK(wait);
|
||||||
struct bio *bio;
|
struct bio *bio;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
bio = bio_alloc(GFP_NOIO, 1);
|
bio = bio_alloc(GFP_NOIO, 1);
|
||||||
bio->bi_sector = sector;
|
bio->bi_sector = sector;
|
||||||
@ -54,8 +55,10 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
|
|||||||
wait_for_completion(&wait);
|
wait_for_completion(&wait);
|
||||||
|
|
||||||
if (!bio_flagged(bio, BIO_UPTODATE))
|
if (!bio_flagged(bio, BIO_UPTODATE))
|
||||||
return -EIO;
|
ret = -EIO;
|
||||||
return 0;
|
|
||||||
|
bio_put(bio);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
|
static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user