linux/drivers/mtd/maps
Dan Carpenter 4631ce7f81 mtd: pmcmsp-flash: Allocating too much in init_msp_flash()
commit 79ad07d457 upstream.

There is a cut and paste issue here.  The bug is that we are allocating
more memory than necessary for msp_maps.  We should be allocating enough
space for a map_info struct (144 bytes) but we instead allocate enough
for an mtd_info struct (1840 bytes).  It's a small waste.

The other part of this is not harmful but when we allocated msp_flash
then we allocated enough space fro a map_info pointer instead of an
mtd_info pointer.  But since pointers are the same size it works out
fine.

Anyway, I decided to clean up all three allocations a bit to make them
a bit more consistent and clear.

Fixes: 68aa0fa87f ('[MTD] PMC MSP71xx flash/rootfs mappings')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:16:52 +00:00
..
amd76xrom.c mtd: fix a number of checkpatch complaints 2012-11-22 12:16:28 +02:00
bfin-async-flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
cfi_flagadm.c mtd: maps: cfi_flagadm: add missing __iomem annotation 2013-08-30 21:51:49 +01:00
ck804xrom.c mtd: maps: Remove redundant NULL check before kfree 2013-04-05 12:54:27 +01:00
dc21285.c mtd: dc21285: use raw spinlock functions for nw_gpio_lock 2015-07-15 10:01:21 +01:00
esb2rom.c Drivers: mtd: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
gpio-addr-flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
ichxrom.c mtd: fix a number of checkpatch complaints 2012-11-22 12:16:28 +02:00
impa7.c mtd: impa7: add missing __iomem annotation 2013-08-30 21:51:40 +01:00
intel_vr_nor.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
ixp4xx.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
Kconfig mtd: Fix Elan SC520 dependencies 2014-05-12 11:55:53 -07:00
l440gx.c mtd: maps: l440gx: Add reference counter to set_vpp() 2012-03-27 00:52:49 +01:00
lantiq-flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
latch-addr-flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
Makefile mtd: remove obsolete JEDEC mapping drivers 2013-08-05 21:01:08 +01:00
map_funcs.c MTD/JFFS2: remove CVS keywords 2008-06-04 17:50:17 +01:00
netsc520.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
nettel.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
pci.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
pcmciamtd.c MTD merge for 3.4 2012-03-30 17:31:56 -07:00
physmap.c mtd: maps: use dev_get_platdata() 2013-08-30 21:34:32 +01:00
physmap_of.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
pismo.c Drivers: mtd: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
plat-ram.c mtd: plat-ram: Remove unnecessary OOM messages 2014-03-10 22:42:24 -07:00
pmcmsp-flash.c mtd: pmcmsp-flash: Allocating too much in init_msp_flash() 2016-11-20 01:16:52 +00:00
pxa2xx-flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
rbtx4939-flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
sa1100-flash.c mtd: maps: use dev_get_platdata() 2013-08-30 21:34:32 +01:00
sbc_gxx.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
sc520cdp.c mtd: maps: sc520cdp: fix warnings 2014-05-28 00:05:24 -07:00
scb2_flash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
scx200_docflash.c mtd: scx200_docflash: convert to mtd_device_register() 2011-05-25 02:22:04 +01:00
solutionengine.c mtd: maps: remove check for CONFIG_MTD_SUPERH_RESERVE 2014-05-28 15:12:47 -07:00
sun_uflash.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
ts5500_flash.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
tsunami_flash.c mtd: maps: add const qualifiers 2013-04-05 13:04:20 +01:00
uclinux.c mtd: uclinux: add a comment about why uclinux_ram_map must not be static 2013-02-04 09:26:30 +02:00
vmu-flash.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00