[PATCH] udf: check if udf_load_logicalvol failed

From: marcin . slusarz
Date: Sat Jan 05 2008 - 19:44:55 EST


udf_load_logicalvol may fail eg in out of memory conditions - check it
and propagate error further

Signed-off-by: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>
CC: Ben Fennema <bfennema@xxxxxxxxxxxxxxxxxxxxxx>
CC: Jan Kara <jack@xxxxxxx>
CC: Christoph Hellwig <hch@xxxxxxxxxxxxx>
---
fs/udf/super.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 3f5b632..c09e968 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1188,6 +1188,7 @@ static int udf_process_sequence(struct super_block *sb, long block,
uint32_t vdsn;
uint16_t ident;
long next_s = 0, next_e = 0;
+ int ret;

memset(vds, 0, sizeof(struct udf_vds_record) * VDS_POS_LENGTH);

@@ -1263,7 +1264,11 @@ static int udf_process_sequence(struct super_block *sb, long block,
if (i == VDS_POS_PRIMARY_VOL_DESC) {
udf_load_pvoldesc(sb, bh);
} else if (i == VDS_POS_LOGICAL_VOL_DESC) {
- udf_load_logicalvol(sb, bh, fileset); /* TODO: check return value */
+ ret = udf_load_logicalvol(sb, bh, fileset);
+ if (ret != 0) {
+ brelse(bh);
+ return ret;
+ }
} else if (i == VDS_POS_PARTITION_DESC) {
struct buffer_head *bh2 = NULL;
if (udf_load_partdesc(sb, bh)) {
--
1.5.3.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/