]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fs/squashfs: sqfs_probe: reset cur_dev/cur_part_info to NULL on error
authorRichard Genoud <richard.genoud@posteo.net>
Tue, 3 Nov 2020 11:11:21 +0000 (12:11 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 19 Nov 2020 14:45:49 +0000 (09:45 -0500)
Resetting the context on error will prevent some checks like:
if (!ctx.cur_dev)
To pass when the probe method has failed

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
fs/squashfs/sqfs.c

index 7d6f0e88e31ef3843e36b85d9363d7dd25709815..96806a4a31d814d46a67f409a05fb9b821f8d285 100644 (file)
@@ -1085,7 +1085,7 @@ int sqfs_probe(struct blk_desc *fs_dev_desc, struct disk_partition *fs_partition
 
        ret = sqfs_read_sblk(&sblk);
        if (ret)
-               return ret;
+               goto error;
 
        /* Make sure it has a valid SquashFS magic number*/
        if (get_unaligned_le32(&sblk->s_magic) != SQFS_MAGIC_NUMBER) {