From: Nikola Pajkovsky Date: Tue, 14 Aug 2012 22:38:08 +0000 (+0200) Subject: udf: fix retun value on error path in udf_load_logicalvol X-Git-Tag: v3.4.14~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e08ea4c7d4e90aab75307c3c8018d2d4bbeebc0b;p=karo-tx-linux.git 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 Signed-off-by: Jan Kara Cc: Herton Ronaldo Krzesinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/udf/super.c b/fs/udf/super.c index e660ffdd91b6..4988a8afcc8f 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1287,6 +1287,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; } @@ -1331,8 +1332,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))) {