e2fsprogs: remove leftover retval check
PATCH 1/1 e2fsprogs: remove leftover retval check
Remove leftover retval check from the read_bitmaps(). It is not necessary as it is not previously set by any function, moreover the retval value is not initialized in definition which may cause errors when garbage data appears in it.
Also initialize retval to zero in definition.
Signed-off-by Lukas Czerner <[email protected]>
--- lib/ext2fs/rw_bitmaps.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
lib/ext2fs/rw_bitmaps.c +1 -3
@@ -33,7 +33,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)unsigned int j;int block_nbytes, inode_nbytes;unsigned int nbits; -errcode_t retval; +errcode_t retval =0 ;char *block_buf, *inode_buf;int csum_flag =0 ;blk64_t blk;
@@ -159,8 +159,6 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) csum_flag =1 ; -if (retval) -return retval;if (do_block) {if (fs->block_map)ext2fs_free_block_bitmap (fs->block_map);
Signature · 1 line
1.7.4
Quoted 8 lines · Lukas Czerner
Remove leftover retval check from the
read_bitmaps(). It is not necessary as it is not previously set by any function, moreover the retval value is not initialized in definition which may cause errors when garbage data appears in it.Also initialize retval to zero in definition.
Signed-off-by Lukas Czerner <[email protected]>
Once again I was too hasty. Please ignore it, this is not present in master branch. Sorry for the noise!
-Lukas
Quoted 27 lines
--- lib/ext2fs/rw_bitmaps.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)lib/ext2fs/rw_bitmaps.c +1
-3@@ -33,7 +33,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)unsigned int j;int block_nbytes, inode_nbytes;unsigned int nbits; -errcode_t retval; +errcode_t retval =0 ;char *block_buf, *inode_buf;int csum_flag =0 ;blk64_t blk;@@ -159,8 +159,6 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) csum_flag =1 ; -if (retval) -return retval;if (do_block) {if (fs->block_map)ext2fs_free_block_bitmap (fs->block_map);