Skip to content

Commit 7b4cc16

Browse files
xiubligregkh
authored andcommitted
ceph: initialize pathlen variable in reconnect_caps_cb
[ Upstream commit ee2a095 ] The smatch static checker warned about an uninitialized symbol usage in this function, in the case where ceph_mdsc_build_path returns an error. It turns out that that case is harmless, but it just looks sketchy. Initialize the variable at declaration time, and remove the unneeded setting of it later. Fixes: a33f643 ("ceph: encode inodes' parent/d_name in cap reconnect message") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e0f06c3 commit 7b4cc16

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/ceph/mds_client.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,7 +3696,7 @@ static int reconnect_caps_cb(struct inode *inode, struct ceph_cap *cap,
36963696
struct ceph_pagelist *pagelist = recon_state->pagelist;
36973697
struct dentry *dentry;
36983698
char *path;
3699-
int pathlen, err;
3699+
int pathlen = 0, err;
37003700
u64 pathbase;
37013701
u64 snap_follows;
37023702

@@ -3716,7 +3716,6 @@ static int reconnect_caps_cb(struct inode *inode, struct ceph_cap *cap,
37163716
}
37173717
} else {
37183718
path = NULL;
3719-
pathlen = 0;
37203719
pathbase = 0;
37213720
}
37223721

0 commit comments

Comments
 (0)