Skip to contentSkip to conversation

Fixes return checks of functions affs_truncate and affs_grow_extcache

PATCH New Nicholas Krause 1 participant 1 message Jun 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes return checks of functions affs_truncate and affs_grow_extcache

---
 fs/affs/file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/affs/file.c +3 -1
index a227cec..15bc7f6 100644
@@ -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;
Signature · 1 line
1.9.1