]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
udf: check if udf_load_logicalvol failed
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Fri, 8 Feb 2008 12:20:33 +0000 (04:20 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:35 +0000 (09:22 -0800)
udf_load_logicalvol may fail eg in out of memory conditions - check it
and propagate error further

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Ben Fennema <bfennema@falcon.csc.calpoly.edu>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/udf/super.c

index 4d1e197164b7cf40fc9fbd247682c9cfd8773e74..913ece8eec61819562048f43717c9c2faa7f0a09 100644 (file)
@@ -1263,7 +1263,10 @@ 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 */
+                               if (udf_load_logicalvol(sb, bh, fileset)) {
+                                       brelse(bh);
+                                       return 1;
+                               }
                        } else if (i == VDS_POS_PARTITION_DESC) {
                                struct buffer_head *bh2 = NULL;
                                if (udf_load_partdesc(sb, bh)) {