[PATCH] affs: possible null pointer dereference in affs_rename()

If affs_bread() fails, the exit path calls mark_buffer_dirty_inode() with a
NULL argument.

Coverity CID: 312.

Signed-off-by: Florin Malita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Florin Malita authored and Linus Torvalds committed 2006-05-26 11:55:46 -07:00
1 parent 9084533e79
commit 3ac8141366
1 file changed
+1 -2
+1 -2
View File
@@ -416,10 +416,9 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
return retval;
}
retval = -EIO;
bh = affs_bread(sb, old_dentry->d_inode->i_ino);
if (!bh)
goto done;
return -EIO;
/* Remove header from its parent directory. */
affs_lock_dir(old_dir);