Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nikola Pajkovsky and committed by
Jan Kara
68766a2e 2e84f264

+4 -1
+4 -1
fs/udf/super.c
··· 1344 1344 udf_err(sb, "error loading logical volume descriptor: " 1345 1345 "Partition table too long (%u > %lu)\n", table_len, 1346 1346 sb->s_blocksize - sizeof(*lvd)); 1347 + ret = 1; 1347 1348 goto out_bh; 1348 1349 } 1349 1350 ··· 1389 1388 UDF_ID_SPARABLE, 1390 1389 strlen(UDF_ID_SPARABLE))) { 1391 1390 if (udf_load_sparable_map(sb, map, 1392 - (struct sparablePartitionMap *)gpm) < 0) 1391 + (struct sparablePartitionMap *)gpm) < 0) { 1392 + ret = 1; 1393 1393 goto out_bh; 1394 + } 1394 1395 } else if (!strncmp(upm2->partIdent.ident, 1395 1396 UDF_ID_METADATA, 1396 1397 strlen(UDF_ID_METADATA))) {