[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] 2.6 patch] fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference



Don't dereference new->s_root when we do know it's NULL.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk stusta de>

--- linux-2.6/fs/gfs2/ops_fstype.c.old	2006-10-19 15:24:23.000000000 +0200
+++ linux-2.6/fs/gfs2/ops_fstype.c	2006-10-19 15:24:32.000000000 +0200
@@ -793,10 +793,10 @@ static int fill_super_meta(struct super_
 	if (!new->s_root) {
 		fs_err(sdp, "can't get root dentry\n");
 		error = -ENOMEM;
 		iput(inode);
-	}
-	new->s_root->d_op = &gfs2_dops;
+	} else
+		new->s_root->d_op = &gfs2_dops;
 
 	return error;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]