X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_vfs_multi.c;h=27cc0c010d73b7ce6d934ad948fe6dae66eef21a;hp=85826553043b2d7e3741f76d08bae118e10cd425;hb=e72372f93c862b499f586006cd30a5052fde38f8;hpb=3a8580e503eed62cebb7b1b4fc3f3f4211010466 diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 8582655..27cc0c0 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -2610,6 +2610,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, struct yaffs_param *param; int read_only = 0; + int inband_tags = 0; struct yaffs_options options; @@ -2688,7 +2689,11 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, yaffs_version = 1; } - if(yaffs_verify_mtd(mtd, yaffs_version, options.inband_tags) < 0) + if (mtd->oobavail < sizeof(struct yaffs_packed_tags2) || + options.inband_tags) + inband_tags = 1; + + if(yaffs_verify_mtd(mtd, yaffs_version, inband_tags) < 0) return NULL; /* OK, so if we got here, we have an MTD that's NAND and looks @@ -2708,15 +2713,11 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, context = kmalloc(sizeof(struct yaffs_linux_context), GFP_KERNEL); if (!dev || !context) { - if (dev) - kfree(dev); - if (context) - kfree(context); + kfree(dev); + kfree(context); dev = NULL; context = NULL; - } - if (!dev) { /* Deep shit could not allocate device structure */ yaffs_trace(YAFFS_TRACE_ALWAYS, "yaffs_read_super: Failed trying to allocate struct yaffs_dev." @@ -2749,10 +2750,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, param->n_reserved_blocks = 5; param->n_caches = (options.no_cache) ? 0 : 10; - - if (mtd->oobavail < sizeof(struct yaffs_packed_tags2) || - options.inband_tags) - param->inband_tags = 1; + param->inband_tags = inband_tags; param->enable_xattr = 1; if (options.lazy_loading_overridden)