mtd: nand: ams-delta: fix overwritten mtd_info->owner in initialization
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 11 Jan 2015 13:07:20 +0000 (22:07 +0900)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 16 Jan 2015 03:33:03 +0000 (19:33 -0800)
commit526789fc532a445975b60885a65d3cea5bfa6391
tree0eb84eff47509421c965fe3344ae7ce12be020ec
parent45c6a0caeb2bde9e043bcd833af322db57a37498
mtd: nand: ams-delta: fix overwritten mtd_info->owner in initialization

In initialization routine, mtd_info->owner is overwritten by memset()
just after being initialized.  This can be fixed by moving memset() calls
to just before setting mtd_info->owner.  But the memory region is allocated
by kmalloc, so we can fix it by using kzalloc instead of kmalloc.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jonathan McDowell <noodles@earth.li>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/ams-delta.c