From: Florin Malita Date: Fri, 26 May 2006 01:44:23 +0000 (-0700) Subject: [PATCH] affs: possible null pointer dereference in affs_rename() X-Git-Tag: v2.6.17-rc6~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ac8141366932a74fd8620afaebd66960c91196d;p=platform%2Fkernel%2Flinux-exynos.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/affs/namei.c b/fs/affs/namei.c index d4c2d63..a42143c 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);