Skip to content

Commit 77364fa

Browse files
Tom Rixkdave
authored andcommitted
btrfs: initialize return variable in cleanup_free_space_cache_v1
Static analysis reports this problem free-space-cache.c:3965:2: warning: Undefined or garbage value returned return ret; ^~~~~~~~~~ ret is set in the node handling loop. Treat doing nothing as a success and initialize ret to 0, although it's unlikely the loop would be skipped. We always have block groups, but as it could lead to transaction abort in the caller it's better to be safe. CC: [email protected] # 5.12+ Signed-off-by: Tom Rix <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 784daf2 commit 77364fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/free-space-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3949,7 +3949,7 @@ static int cleanup_free_space_cache_v1(struct btrfs_fs_info *fs_info,
39493949
{
39503950
struct btrfs_block_group *block_group;
39513951
struct rb_node *node;
3952-
int ret;
3952+
int ret = 0;
39533953

39543954
btrfs_info(fs_info, "cleaning free space cache v1");
39553955

0 commit comments

Comments
 (0)