Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Florin Malita and committed by
Linus Torvalds
3ac81413 9084533e

+1 -2
+1 -2
fs/affs/namei.c
··· 416 416 return retval; 417 417 } 418 418 419 - retval = -EIO; 420 419 bh = affs_bread(sb, old_dentry->d_inode->i_ino); 421 420 if (!bh) 422 - goto done; 421 + return -EIO; 423 422 424 423 /* Remove header from its parent directory. */ 425 424 affs_lock_dir(old_dir);