Skip to content

Commit 8ea2e06

Browse files
Herbert Valerio RiedelThomas Gleixner
authored andcommitted
[MTD] FTL Fix missing pointer assignment
For the case that mtd partitions are enabled it would cause a 0-pointer dereferencing in mtdpart.c:mtd_erase_callback() Signed-off-by: Herbert Valerio Riedel <hvr@inso.tuwien.ac.at> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 14f8351 commit 8ea2e06

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/mtd/ftl.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This version ported to the Linux-MTD system by dwmw2@infradead.org
2-
* $Id: ftl.c,v 1.54 2004/11/16 18:33:15 dwmw2 Exp $
2+
* $Id: ftl.c,v 1.55 2005/01/17 13:47:21 hvr Exp $
33
*
44
* Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
55
* - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
@@ -357,6 +357,7 @@ static int erase_xfer(partition_t *part,
357357
if (!erase)
358358
return -ENOMEM;
359359

360+
erase->mtd = part->mbd.mtd;
360361
erase->callback = ftl_erase_callback;
361362
erase->addr = xfer->Offset;
362363
erase->len = 1 << part->header.EraseUnitSize;
@@ -1096,7 +1097,7 @@ struct mtd_blktrans_ops ftl_tr = {
10961097

10971098
int init_ftl(void)
10981099
{
1099-
DEBUG(0, "$Id: ftl.c,v 1.54 2004/11/16 18:33:15 dwmw2 Exp $\n");
1100+
DEBUG(0, "$Id: ftl.c,v 1.55 2005/01/17 13:47:21 hvr Exp $\n");
11001101

11011102
return register_mtd_blktrans(&ftl_tr);
11021103
}

0 commit comments

Comments
 (0)