Skip to contentSkip to conversation

affs: possible null pointer dereference in affs_rename()

PATCH New Florin Malita 1 participant 1 message May 24, 2006 Affs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

fs/affs/namei.c +1 -2
index d4c2d63..a42143c 100644
@@ -416,10 +416,9 @@ affs_rename(struct inode *old_dir, struc
 			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);