fs: fat: simplify gotos from read_bootsectandvi

This simplifies the code a little bit.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
This commit is contained in:
Christian Taedcke
2023-11-15 13:44:19 +01:00
committed by Tom Rini
parent 08f622a127
commit 33daef49b0

View File

@@ -531,7 +531,8 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
if (disk_read(0, 1, block) < 0) { if (disk_read(0, 1, block) < 0) {
debug("Error: reading block\n"); debug("Error: reading block\n");
goto fail; ret = -1;
goto out_free;
} }
memcpy(bs, block, sizeof(boot_sector)); memcpy(bs, block, sizeof(boot_sector));
@@ -556,10 +557,8 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
*fatsize = determine_legacy_fat_bits(bs); *fatsize = determine_legacy_fat_bits(bs);
} }
memcpy(volinfo, vistart, sizeof(volume_info)); memcpy(volinfo, vistart, sizeof(volume_info));
goto exit;
fail: out_free:
ret = -1;
exit:
free(block); free(block);
return ret; return ret;
} }