]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: initialize pathlen variable in reconnect_caps_cb
authorXiubo Li <xiubli@redhat.com>
Tue, 30 Nov 2021 11:20:34 +0000 (19:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:38 +0000 (09:32 +0100)
commit51ea6d9243287be517830948f385e42d3d049fde
treecc752b6d451bf1da2e684b9e0d89049b2f88bae2
parent808d4eb0e86776570bc8a277c72d6cd92333bfef
ceph: initialize pathlen variable in reconnect_caps_cb

[ Upstream commit f667a8dde2a0850098e86e8a1b7e66625ad7e7ad ]

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: 2cbe9c41b8c3 ("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>
fs/ceph/mds_client.c