Skip to contentSkip to conversation

gfs:remove a warning in gfs2_lookup_by_inum()

PATCH In review Weiping Pan(潘卫平) 2 participants 2 messages Apr 11, 2011 – Apr 13, 2011 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gfs:remove a warning in gfs2_lookup_by_inum()

/home/pwp/mysvn/linux/linux-2.6/fs/gfs2/inode.c: In function ‘gfs2_lookup_by_inum’: /home/pwp/mysvn/linux/linux-2.6/fs/gfs2/inode.c:188:16:
warning: ‘inode’ may be used uninitialized in this function

---
 fs/gfs2/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/inode.c +1 -1
index 97d54a2..5b937c6 100644
@@ -185,7 +185,7 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
 {
 	struct super_block *sb = sdp->sd_vfs;
 	struct gfs2_holder i_gh;
-	struct inode *inode;
+	struct inode *inode = NULL;
 	int error;
 
 	error = gfs2_glock_nq_num(sdp, no_addr, &gfs2_inode_glops,
Signature · 1 line
1.7.4
#1 lore raw

Hi,

Thanks for the patch, however a fix for this is already in the GFS2 -nmw git tree,

Steve.

Quoted 22 lines · Weiping Pan(潘卫平)

/home/pwp/mysvn/linux/linux-2.6/fs/gfs2/inode.c: In function ‘gfs2_lookup_by_inum’: /home/pwp/mysvn/linux/linux-2.6/fs/gfs2/inode.c:188:16:
warning: ‘inode’ may be used uninitialized in this function

---
 fs/gfs2/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/inode.c +1 -1
index 97d54a2..5b937c6 100644
@@ -185,7 +185,7 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
 {
 	struct super_block *sb = sdp->sd_vfs;
 	struct gfs2_holder i_gh;
-	struct inode *inode;
+	struct inode *inode = NULL;
 	int error;
 
 	error = gfs2_glock_nq_num(sdp, no_addr, &gfs2_inode_glops,