]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: fix stupid compiler warning
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Dec 2025 21:44:15 +0000 (13:44 -0800)
committerCarlos Maiolino <cem@kernel.org>
Tue, 16 Dec 2025 07:50:07 +0000 (08:50 +0100)
commitf06725052098d7b1133ac3846d693c383dc427a2
tree4a6b1b5898b81c83d99073c56c52c20dde34672f
parent5990fd756943836978ad184aac980e2b36ab7e01
xfs: fix stupid compiler warning

gcc 14.2 warns about:

xfs_attr_item.c: In function ‘xfs_attr_recover_work’:
xfs_attr_item.c:785:9: warning: ‘ip’ may be used uninitialized [-Wmaybe-uninitialized]
  785 |         xfs_trans_ijoin(tp, ip, 0);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
xfs_attr_item.c:740:42: note: ‘ip’ was declared here
  740 |         struct xfs_inode                *ip;
      |                                          ^~

I think this is bogus since xfs_attri_recover_work either returns a real
pointer having initialized ip or an ERR_PTR having not touched it, but
the tools are smarter than me so let's just null-init the variable
anyway.

Cc: stable@vger.kernel.org # v6.8
Fixes: e70fb328d52772 ("xfs: recreate work items when recovering intent items")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_attr_item.c