Skip to content

Commit

Permalink
fix newly introduced missing cleanup when an invalid superblock is fo…
Browse files Browse the repository at this point in the history
…und.
  • Loading branch information
BrianPugh committed Aug 18, 2023
1 parent 2ebfec7 commit 7521e0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4420,13 +4420,13 @@ static int lfs_rawformat(lfs_t *lfs, const struct lfs_config *cfg) {
lfs_superblock_t superblock;
err = lfs_scan_for_superblock(lfs, &superblock);
if(err){
return err;
goto cleanup;
}
lfs->block_count = superblock.block_count;

err = lfs_validate_superblock(lfs, &superblock);
if(err){
return err;
goto cleanup;
}
}

Expand Down Expand Up @@ -4505,7 +4505,7 @@ static int lfs_rawmount(lfs_t *lfs, const struct lfs_config *cfg) {

err = lfs_validate_superblock(lfs, &superblock);
if(err){
return err;
goto cleanup;
}

err = lfs_scan_for_state_updates(lfs);
Expand Down

0 comments on commit 7521e0a

Please sign in to comment.