Skip to content

Commit

Permalink
[PATCH] affs: possible null pointer dereference in affs_rename()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Florin Malita authored and Linus Torvalds committed May 26, 2006
1 parent 9084533 commit 3ac8141
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/affs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ac8141

Please sign in to comment.