From: Nicholas Krause Subject: [PATCH] Fixes return checks of functions affs_truncate and affs_grow_extcache Date: Tue, 17 Jun 2014 16:55:24 -0400 Message-ID: <1403038524-8284-1-git-send-email-xerofoify@gmail.com> Cc: viro@zeniv.linux.org.uk, fabf@skynet.be, kirill.shutemov@linux.intel.com, dan.carpenter@oracle.com, linux-fsdevel@vger.kernel.org To: akpm@linux-foundation.org Return-path: Received: from mail-ig0-f180.google.com ([209.85.213.180]:34104 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965420AbaFQVSp (ORCPT ); Tue, 17 Jun 2014 17:18:45 -0400 Received: by mail-ig0-f180.google.com with SMTP id h18so74775igc.1 for ; Tue, 17 Jun 2014 14:18:26 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Nicholas Krause --- fs/affs/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/affs/file.c b/fs/affs/file.c index a227cec..15bc7f6 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -121,9 +121,9 @@ affs_grow_extcache(struct inode *inode, u32 lc_idx) j = AFFS_I(inode)->i_lc_mask + 1; // unlock cache for (; j > 0; j--) { + if (!bh) + goto err; bh = affs_bread(sb, key); key = be32_to_cpu(AFFS_TAIL(sb, bh)->extension); affs_brelse(bh); } @@ -924,7 +924,7 @@ affs_truncate(struct inode *inode) while (ext_key) { ext_bh = affs_bread(sb, ext_key); if(!ext_bh) - goto err; + return; size = AFFS_SB(sb)->s_hashsize; if (size > blkcnt - blk) size = blkcnt - blk; -- 1.9.1