Skip to contentSkip to conversation

fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference

PATCH New Steven Whitehouse 1 participant 1 message Oct 20, 2006 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 7/8 fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference

Quoted 1 line

From bbbe4512735eb0f15f09ffd14876091a8e91bc69 Mon Sep 17 00:00:00 2001

From: Adrian Bunk <[email protected]>
Date: Thu, 19 Oct 2006 15:27:00 +0200
Subject: [GFS2] 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.

---
 fs/gfs2/ops_fstype.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/ops_fstype.c +2 -2
index e99444d..882873a 100644
@@ -794,8 +794,8 @@ static int fill_super_meta(struct super_
 		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;
 }
Signature · 1 line
1.4.1