diff options
author | Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> | 2025-06-02 11:49:56 -0700 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2025-06-06 11:08:59 +0200 |
commit | b828b4bf29d10a3e505a76a39c4daea969e19dc9 (patch) | |
tree | 010d485d305d0bdea8d082f9a1ebb2ecfcf89a3a /scripts/generate_rust_analyzer.py | |
parent | 72386d5245b249f5a0a8fabb881df7ad947b8ea4 (diff) |
ceph: fix variable dereferenced before check in ceph_umount_begin()
smatch warnings:
fs/ceph/super.c:1042 ceph_umount_begin() warn: variable dereferenced before check 'fsc' (see line 1041)
vim +/fsc +1042 fs/ceph/super.c
void ceph_umount_begin(struct super_block *sb)
{
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
doutc(fsc->client, "starting forced umount\n");
^^^^^^^^^^^
Dereferenced
if (!fsc)
^^^^
Checked too late.
return;
fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
__ceph_umount_begin(fsc);
}
The VFS guarantees that the superblock is still
alive when it calls into ceph via ->umount_begin().
Finally, we don't need to check the fsc and
it should be valid. This patch simply removes
the fsc check.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202503280852.YDB3pxUY-lkp@intel.com/
Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions