Skip to contentSkip to conversation

libxfs: fix uninit variable in libxfs_alloc_file_space

PATCH In review Darrick J. Wong 2 participants 2 messages Jan 9, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxfs: fix uninit variable in libxfs_alloc_file_space

From: Darrick J. Wong <[email protected]>

Fix this uninitialized variable.

Coverity-id: 1637359

Fixes b48164b8cd7618 ("libxfs: resync libxfs_alloc_file_space interface with the kernel")
---
 libxfs/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/util.c +1 -1
index 4a9dd254083a63..3597850ddccb9a 100644
@@ -193,7 +193,7 @@ libxfs_alloc_file_space(
 	int			rt;
 	xfs_trans_t		*tp;
 	xfs_bmbt_irec_t		imaps[1], *imapp;
-	int			error;
+	int			error = 0;
 
 	if (len <= 0)
 		return -EINVAL;