Re: [ceph-client:tls_logger 19/40] fs/ceph/super.c:1042 ceph_umount_begin() warn: variable dereferenced before check 'fsc' (see line 1041)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2025-03-28 at 08:26 +0300, Dan Carpenter wrote:
> tree:   https://github.com/ceph/ceph-client.git   tls_logger
> head:   3d957afa4285ed4deaaf42d200ba7ee1f3092f8d
> commit: 75b56e556ea415e29a13a8b7e98d302fbbec4c01 [19/40] cephsan new logger
> config: x86_64-randconfig-r071-20250328 (https://download.01.org/0day-ci/archive/20250328/202503280852.YDB3pxUY-lkp@xxxxxxxxx/config  )
> compiler: clang version 20.1.1 (https://github.com/llvm/llvm-project   424c2d9b7e4de40d0804dd374721e6411c27d1d1)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> > Closes: https://lore.kernel.org/r/202503280852.YDB3pxUY-lkp@xxxxxxxxx/  
> 
> 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
> 
> 631ed4b0828727 Jeff Layton  2021-10-14  1037  void ceph_umount_begin(struct super_block *sb)
> 16725b9d2a2e3d Sage Weil    2009-10-06  1038  {
> 5995d90d2d19f3 Xiubo Li     2023-06-12  1039  	struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
> 3d14c5d2b6e15c Yehuda Sadeh 2010-04-06  1040  
> 38d46409c4639a Xiubo Li     2023-06-12 @1041  	doutc(fsc->client, "starting forced umount\n");
>                                                       ^^^^^^^^^^^
> Dereferenced
> 
> 3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 @1042  	if (!fsc)
>                                                     ^^^^
> Checked too late.
> 

Yeah, makes sense. Let me fix it.

Thanks,
Slava.

> 3d14c5d2b6e15c Yehuda Sadeh 2010-04-06  1043  		return;
> 3d14c5d2b6e15c Yehuda Sadeh 2010-04-06  1044  	fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
> 50c9132ddfb202 Jeff Layton  2020-09-25  1045  	__ceph_umount_begin(fsc);
> 16725b9d2a2e3d Sage Weil    2009-10-06  1046  }
> 






[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux