fs/xfs/xfs_zone_alloc.c:32:5-24: WARNING: atomic_dec_and_test variation before object free at line 34.

From: kernel test robot
Date: Thu Jan 01 2026 - 16:10:59 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b69053dd3ffbc0d2dedbbc86182cdef6f641fe1b
commit: 4e4d52075577707f8393e3fc74c1ef79ca1d3ce6 xfs: add the zoned space allocator
date: 10 months ago
config: arm-randconfig-r051-20251231 (https://download.01.org/0day-ci/archive/20260102/202601020543.BxObPuzj-lkp@xxxxxxxxx/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 86b9f90b9574b3a7d15d28a91f6316459dcfa046)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601020543.BxObPuzj-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_zone_alloc.c:32:5-24: WARNING: atomic_dec_and_test variation before object free at line 34.

vim +32 fs/xfs/xfs_zone_alloc.c

27
28 void
29 xfs_open_zone_put(
30 struct xfs_open_zone *oz)
31 {
> 32 if (atomic_dec_and_test(&oz->oz_ref)) {
33 xfs_rtgroup_rele(oz->oz_rtg);
> 34 kfree(oz);
35 }
36 }
37

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki