]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fs: fat: simplify gotos from read_bootsectandvi
authorChristian Taedcke <christian.taedcke@weidmueller.com>
Wed, 15 Nov 2023 12:44:19 +0000 (13:44 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 29 Nov 2023 01:10:24 +0000 (20:10 -0500)
This simplifies the code a little bit.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
fs/fat/fat.c

index c368c3b076589376f8eb65abcdd4f4825bc33465..77f225ccd8d0d9565b7c7359f12c70bf84499a90 100644 (file)
@@ -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;
 }