[PATCH] hfsplus: rework processing of return value of bio_alloc() in hfsplus_submit_bio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This patch adds logic of checking return value of bio_alloc() in hfsplus_submit_bio(). In the case of NULL the hfsplus_submit_bio() returns -EIO.

With the best regards,
Vyacheslav Dubeyko.
--
From: Vyacheslav Dubeyko <slava@xxxxxxxxxxx>
Subject: [PATCH] hfsplus: rework processing of return value of bio_alloc() in hfsplus_submit_bio()

This patch adds logic of checking return value of bio_alloc() in hfsplus_submit_bio(). In the case of NULL the hfsplus_submit_bio() returns -EIO.

Signed-off-by: Vyacheslav Dubeyko <slava@xxxxxxxxxxx>
---
 fs/hfsplus/wrapper.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 90effcc..ec06bd4 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -71,6 +71,9 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
 	sector &= ~((io_size >> HFSPLUS_SECTOR_SHIFT) - 1);
 
 	bio = bio_alloc(GFP_NOIO, 1);
+	if (!bio)
+		return -EIO;
+
 	bio->bi_sector = sector;
 	bio->bi_bdev = sb->s_bdev;
 	bio->bi_end_io = hfsplus_end_io_sync;
-- 
1.7.9.5



--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux