patch-2.4.21 linux-2.4.21/drivers/mtd/mtdconcat.c

Next file: linux-2.4.21/drivers/mtd/mtdcore.c
Previous file: linux-2.4.21/drivers/mtd/mtdchar.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/mtd/mtdconcat.c linux-2.4.21/drivers/mtd/mtdconcat.c
@@ -5,7 +5,7 @@
  *
  * This code is GPL
  *
- * $Id: mtdconcat.c,v 1.2 2002/03/22 08:45:22 dwmw2 Exp $
+ * $Id: mtdconcat.c,v 1.3 2002/05/21 21:04:25 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -303,11 +303,14 @@
 		 */
 		erase->addr = 0;
 	}
+	kfree(erase);
+	if (err)
+		return err;
+
 	instr->state = MTD_ERASE_DONE;
 	if (instr->callback)
 		instr->callback(instr);
-	kfree(erase);
-	return err;
+	return 0;
 }
 
 static int concat_lock (struct mtd_info *mtd, loff_t ofs, size_t len)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)