Skip to content

Commit 68766a2

Browse files
Nikola Pajkovskyjankara
authored andcommitted
udf: fix retun value on error path in udf_load_logicalvol
In case we detect a problem and bail out, we fail to set "ret" to a nonzero value, and udf_load_logicalvol will mistakenly report success. Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 2e84f26 commit 68766a2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎fs/udf/super.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
13441344
udf_err(sb, "error loading logical volume descriptor: "
13451345
"Partition table too long (%u > %lu)\n", table_len,
13461346
sb->s_blocksize - sizeof(*lvd));
1347+
ret = 1;
13471348
goto out_bh;
13481349
}
13491350

@@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
13881389
UDF_ID_SPARABLE,
13891390
strlen(UDF_ID_SPARABLE))) {
13901391
if (udf_load_sparable_map(sb, map,
1391-
(struct sparablePartitionMap *)gpm) < 0)
1392+
(struct sparablePartitionMap *)gpm) < 0) {
1393+
ret = 1;
13921394
goto out_bh;
1395+
}
13931396
} else if (!strncmp(upm2->partIdent.ident,
13941397
UDF_ID_METADATA,
13951398
strlen(UDF_ID_METADATA))) {

0 commit comments

Comments
 (0)