Skip to content

Commit f067250

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
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: e70fb32 ("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>
1 parent 5990fd7 commit f067250

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/xfs/xfs_attr_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ xfs_attr_recover_work(
737737
struct xfs_attri_log_item *attrip = ATTRI_ITEM(lip);
738738
struct xfs_attr_intent *attr;
739739
struct xfs_mount *mp = lip->li_log->l_mp;
740-
struct xfs_inode *ip;
740+
struct xfs_inode *ip = NULL;
741741
struct xfs_da_args *args;
742742
struct xfs_trans *tp;
743743
struct xfs_trans_res resv;

0 commit comments

Comments
 (0)