summaryrefslogtreecommitdiff
path: root/fs/affs
diff options
context:
space:
mode:
authorFlorin Malita <fmalita@gmail.com>2006-05-25 18:44:23 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-26 11:55:46 -0700
commit3ac8141366932a74fd8620afaebd66960c91196d (patch)
tree1e6d0cc5bbf10f940ba93346b489c9893c7a2bf7 /fs/affs
parent9084533e797f131c923c8883adf91cc2f7ddcfae (diff)
downloadlinux-rpi-3ac8141366932a74fd8620afaebd66960c91196d.tar.gz
linux-rpi-3ac8141366932a74fd8620afaebd66960c91196d.tar.bz2
linux-rpi-3ac8141366932a74fd8620afaebd66960c91196d.zip
[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 <fmalita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/namei.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index d4c2d636c479..a42143ca0169 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -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);