Skip to contentSkip to conversation

reiserfs: potential ERR_PTR dereference

PATCH New Dan Carpenter 1 participant 1 message Jan 15, 2011 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reiserfs: potential ERR_PTR dereference

reiserfs_iget() returns an ERR_PTR on allocation failures. All the other callers check for it so we should check here too.

fs/reiserfs/super.c +1 -1
index 0aab04f..6949b98 100644
@@ -237,7 +237,7 @@ static int finish_unfinished(struct super_block *s)
 		pathrelse(&path);
 
 		inode = reiserfs_iget(s, &obj_key);
-		if (!inode) {
+		if (IS_ERR_OR_NULL(inode)) {
 			/* the unlink almost completed, it just did not manage to remove
 			   "save" link and release objectid */
 			reiserfs_warning(s, "vs-2180", "iget failed for %K",