提交 3ac81413 编写于 作者: F Florin Malita 提交者: Linus Torvalds

[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: NFlorin Malita <fmalita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 9084533e
...@@ -416,10 +416,9 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -416,10 +416,9 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
return retval; return retval;
} }
retval = -EIO;
bh = affs_bread(sb, old_dentry->d_inode->i_ino); bh = affs_bread(sb, old_dentry->d_inode->i_ino);
if (!bh) if (!bh)
goto done; return -EIO;
/* Remove header from its parent directory. */ /* Remove header from its parent directory. */
affs_lock_dir(old_dir); affs_lock_dir(old_dir);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册