From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vyacheslav Dubeyko Subject: [PATCH] hfsplus: rework processing of return value of bio_alloc() in hfsplus_submit_bio() Date: Wed, 28 Nov 2012 13:27:34 +0400 Message-ID: <1354094854.2122.44.camel@slavad-ubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Hin-Tak Leung To: linux-fsdevel@vger.kernel.org, Andrew Morton , Christoph Hellwig , Al Viro Return-path: Received: from oproxy9.bluehost.com ([69.89.24.6]:46367 "HELO oproxy9.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753759Ab2K1J1j (ORCPT ); Wed, 28 Nov 2012 04:27:39 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 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 --- 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