]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/mtd/mtdblock_ro.c
mtd: Update copyright notices
[net-next-2.6.git] / drivers / mtd / mtdblock_ro.c
index 852165f8b1c3510720cfc03ad80c2e68b4cbd728..795a8c0a05b82cf4a7cf0bc5d1e31bed4890b9e4 100644 (file)
@@ -1,7 +1,22 @@
 /*
- * (C) 2003 David Woodhouse <dwmw2@infradead.org>
- *
  * Simple read-only (writable only for RAM) mtdblock driver
+ *
+ * Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
  */
 
 #include <linux/init.h>
@@ -43,13 +58,13 @@ static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        dev->tr = tr;
        dev->readonly = 1;
 
-       add_mtd_blktrans_dev(dev);
+       if (add_mtd_blktrans_dev(dev))
+               kfree(dev);
 }
 
 static void mtdblock_remove_dev(struct mtd_blktrans_dev *dev)
 {
        del_mtd_blktrans_dev(dev);
-       kfree(dev);
 }
 
 static struct mtd_blktrans_ops mtdblock_tr = {