Skip to content

Commit

Permalink
libext2fs: fix compiler warning in ext2fs_orphan_file_block_csum_set()
Browse files Browse the repository at this point in the history
Fixes: daf2d1c ("libext2fs: fix ext2fs_orphan_file_block_csum_set()")
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
tytso committed Dec 10, 2024
1 parent b1b66f4 commit c1e0fa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ext2fs/orphan.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,15 @@ errcode_t ext2fs_orphan_file_block_csum_set(ext2_filsys fs, ext2_ino_t ino,
{
struct ext4_orphan_block_tail *tail;
errcode_t ret;
__u32 crc;
__u32 crc = 0;

if (!ext2fs_has_feature_metadata_csum(fs->super))
return 0;

tail = ext2fs_orphan_block_tail(fs, buf);
ret = ext2fs_orphan_file_block_csum(fs, ino, blk, buf, &crc);
if (ret)
return 0;
tail->ob_checksum = ext2fs_cpu_to_le32(crc);
return ret;
}
Expand Down

0 comments on commit c1e0fa3

Please sign in to comment.