Skip to contentSkip to conversation

ceph: initialize pathbase in the !dentry case in encode_caps_cb()

PATCH In review Ilya Dryomov 2 participants 2 messages Aug 9, 2016 Ceph client

lore
Share & tools
lore

Ilya Dryomov

author maintainer
#0 lore raw

PATCH 1/1 ceph: initialize pathbase in the !dentry case in encode_caps_cb()

pathbase is the base inode; set it to 0 if we've got no path.

Coverity-id: 146348

---
 fs/ceph/mds_client.c | 1 +
 1 file changed, 1 insertion(+)
fs/ceph/mds_client.c +1 -0
index fa59a85226b2..f72d4ae303b2 100644
@@ -2759,6 +2759,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
 	} else {
 		path = NULL;
 		pathlen = 0;
+		pathbase = 0;
 	}
 
 	spin_lock(&ci->i_ceph_lock);
Signature · 1 line
2.4.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ilya Dryomov

pathbase is the base inode; set it to 0 if we've got no path.

Coverity-id: 146348

I'm surprised the compiler didn't complain about this.

Quoted 17 lines
---
 fs/ceph/mds_client.c | 1 +
 1 file changed, 1 insertion(+)
fs/ceph/mds_client.c +1 -0
index fa59a85226b2..f72d4ae303b2 100644
@@ -2759,6 +2759,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
 	} else {
 		path = NULL;
 		pathlen = 0;
+		pathbase = 0;
 	}
 
 	spin_lock(&ci->i_ceph_lock);