Commit 68766a2e authored by Nikola Pajkovsky's avatar Nikola Pajkovsky Committed by Jan Kara

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: default avatarNikola Pajkovsky <npajkovs@redhat.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 2e84f264
...@@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, ...@@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
udf_err(sb, "error loading logical volume descriptor: " udf_err(sb, "error loading logical volume descriptor: "
"Partition table too long (%u > %lu)\n", table_len, "Partition table too long (%u > %lu)\n", table_len,
sb->s_blocksize - sizeof(*lvd)); sb->s_blocksize - sizeof(*lvd));
ret = 1;
goto out_bh; goto out_bh;
} }
...@@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, ...@@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
UDF_ID_SPARABLE, UDF_ID_SPARABLE,
strlen(UDF_ID_SPARABLE))) { strlen(UDF_ID_SPARABLE))) {
if (udf_load_sparable_map(sb, map, if (udf_load_sparable_map(sb, map,
(struct sparablePartitionMap *)gpm) < 0) (struct sparablePartitionMap *)gpm) < 0) {
ret = 1;
goto out_bh; goto out_bh;
}
} else if (!strncmp(upm2->partIdent.ident, } else if (!strncmp(upm2->partIdent.ident,
UDF_ID_METADATA, UDF_ID_METADATA,
strlen(UDF_ID_METADATA))) { strlen(UDF_ID_METADATA))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment