Skip to contentSkip to conversation

Check for Null return of affs_bread in function affs_truncate

PATCH In review Nicholas Krause 2 participants 2 messages Jun 17, 2014

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

PATCH 1/1 Check for Null return of affs_bread in function affs_truncate

---
 fs/affs/file.c | 2 ++
 1 file changed, 2 insertions(+)
fs/affs/file.c +2 -0
index a7fe57d..a227cec 100644
@@ -923,6 +923,8 @@ affs_truncate(struct inode *inode)
 
 	while (ext_key) {
 		ext_bh = affs_bread(sb, ext_key);
+		if (!ext_bh)
+			goto err;
 		size = AFFS_SB(sb)->s_hashsize;
 		if (size > blkcnt - blk)
 			size = blkcnt - blk;
Signature · 1 line
1.9.1