summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Taedcke <christian.taedcke@weidmueller.com>2023-11-15 13:44:19 +0100
committerTom Rini <trini@konsulko.com>2023-11-28 20:10:24 -0500
commit33daef49b072f4aa7564fbbb80e7cab3629beecd (patch)
tree31203fd5ace7cb1eb658fcb1672088f50cb93a5d
parent08f622a12708a0a787c8345532e0b1665b993cab (diff)
downloadu-boot-33daef49b072f4aa7564fbbb80e7cab3629beecd.tar.gz
u-boot-33daef49b072f4aa7564fbbb80e7cab3629beecd.tar.bz2
u-boot-33daef49b072f4aa7564fbbb80e7cab3629beecd.zip
fs: fat: simplify gotos from read_bootsectandvi
This simplifies the code a little bit. Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
-rw-r--r--fs/fat/fat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index c368c3b076..77f225ccd8 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -531,7 +531,8 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
if (disk_read(0, 1, block) < 0) {
debug("Error: reading block\n");
- goto fail;
+ ret = -1;
+ goto out_free;
}
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);
}
memcpy(volinfo, vistart, sizeof(volume_info));
- goto exit;
-fail:
- ret = -1;
-exit:
+
+out_free:
free(block);
return ret;
}