Skip to contentSkip to conversation

udf: fix udf_load_pvoldesc()

PATCH In review Dan Carpenter 2 participants 3 messages May 20, 2015 – May 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udf: fix udf_load_pvoldesc()

There are some missing braces here which means this function never succeeds.

Fixes e9d4cf411f75 ('udf: improve error management in udf_CS0toUTF8()')
fs/udf/super.c +2 -1
index c6a8f5f..b96f190 100644
@@ -937,12 +937,13 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
 		udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident);
 	}
 
-	if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128))
+	if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128)) {
 		ret = udf_CS0toUTF8(outstr, instr);
 		if (ret < 0)
 			goto out_bh;
 
 		udf_debug("volSetIdent[] = '%s'\n", outstr->u_name);
+	}
 
 	ret = 0;
 out_bh:
#1 lore raw
Quoted 5 lines · Dan Carpenter

There are some missing braces here which means this function never succeeds.

Fixes e9d4cf411f75 ('udf: improve error management in udf_CS0toUTF8()')

Thanks for the patch. Added to my tree. Actually, the missing parenthesis
don't cause any real issues since almost all volumes have volIdent and thus ret gets set to 0 in the previous if. But it's certainly good to fix.

Honza

Quoted 19 lines
fs/udf/super.c +2 -1
index c6a8f5f..b96f190 100644
@@ -937,12 +937,13 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
 		udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident);
 	}
 
-	if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128))
+	if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128)) {
 		ret = udf_CS0toUTF8(outstr, instr);
 		if (ret < 0)
 			goto out_bh;
 
 		udf_debug("volSetIdent[] = '%s'\n", outstr->u_name);
+	}
 
 	ret = 0;
 out_bh:
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#2 lore raw
Quoted 9 lines · Jan Kara
Quoted 5 lines · Dan Carpenter

There are some missing braces here which means this function never succeeds.

Fixes e9d4cf411f75 ('udf: improve error management in udf_CS0toUTF8()')

Thanks for the patch. Added to my tree. Actually, the missing parenthesis
don't cause any real issues since almost all volumes have volIdent and thus ret gets set to 0 in the previous if. But it's certainly good to fix.

Ah... I didn't read carefully. Thanks.

regards,
dan carpenter