diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2012-08-15 00:38:08 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-10-17 03:49:50 +0100 |
commit | 9864b931b1185d463c05ef7dff840f4e0d20c605 (patch) | |
tree | f1971a597b786ef14f0e7658046326572fa03ac3 | |
parent | b7a9b74916d8e7ef5ac4970a71cdf411ae1286c8 (diff) |
udf: fix retun value on error path in udf_load_logicalvol
commit 68766a2edcd5cd744262a70a2f67a320ac944760 upstream.
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | fs/udf/super.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 516b7f00ab78..f66439eb9b39 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1289,6 +1289,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, udf_err(sb, "error loading logical volume descriptor: " "Partition table too long (%u > %lu)\n", table_len, sb->s_blocksize - sizeof(*lvd)); + ret = 1; goto out_bh; } @@ -1333,8 +1334,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE))) { if (udf_load_sparable_map(sb, map, - (struct sparablePartitionMap *)gpm) < 0) + (struct sparablePartitionMap *)gpm) < 0) { + ret = 1; goto out_bh; + } } else if (!strncmp(upm2->partIdent.ident, UDF_ID_METADATA, strlen(UDF_ID_METADATA))) { |