]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/inftlcore.c
memory hotplug: fix page_zone() calculation in test_pages_isolated()
[linux-2.6-omap-h63xx.git] / drivers / mtd / inftlcore.c
index c4f9d3378b24c658f246d8777d47735050cfdffe..50ce13887f63b6b81d2525a5070fbfc511643b1c 100644 (file)
@@ -388,6 +388,10 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
                if (thisEUN == targetEUN)
                        break;
 
+               /* Unlink the last block from the chain. */
+               inftl->PUtable[prevEUN] = BLOCK_NIL;
+
+               /* Now try to erase it. */
                if (INFTL_formatblock(inftl, thisEUN) < 0) {
                        /*
                         * Could not erase : mark block as reserved.
@@ -396,7 +400,6 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
                } else {
                        /* Correctly erased : mark it as free */
                        inftl->PUtable[thisEUN] = BLOCK_FREE;
-                       inftl->PUtable[prevEUN] = BLOCK_NIL;
                        inftl->numfreeEUNs++;
                }
        }