alistair23-linux/drivers/mtd
Brian Norris 778d226a14 mtd: m25p80: fix allocation size
This patch fixes two memory errors:

1. During a probe failure (in mtd_device_parse_register?) the command
   buffer would not be freed.

2. The command buffer's size is determined based on the 'fast_read'
   boolean, but the assignment of fast_read is made after this
   allocation. Thus, the buffer may be allocated "too small".

To fix the first, just switch to the devres version of kzalloc.

To fix the second, increase MAX_CMD_SIZE unconditionally. It's not worth
saving a byte to fiddle around with the conditions here.

This problem was reported by Yuhang Wang a while back.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reported-by: Yuhang Wang <wangyuhang2014@gmail.com>
Reviewed-by: Sourav Poddar <sourav.poddar@ti.com>
Cc: <stable@vger.kernel.org>
2013-11-06 23:33:04 -08:00
..
chips mtd: jedec_probe: fix LH28F640BF definition 2013-08-05 21:04:17 +01:00
devices mtd: m25p80: fix allocation size 2013-11-06 23:33:04 -08:00
lpddr mtd: lpddr_cmds: make function static 2013-10-27 16:27:03 -07:00
maps mtd: plat-ram: Use module_platform_driver 2013-11-06 23:32:55 -08:00
nand mtd: gpmi: imx6: fix the wrong method for checking ready/busy 2013-11-06 23:33:03 -08:00
onenand mtd: onenand: omap: remove two unused functions 2013-10-27 16:27:03 -07:00
tests mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
ubi mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
afs.c
ar7part.c
bcm47xxpart.c mtd: bcm47xxpart: detect "factory" partition 2013-11-06 23:32:58 -08:00
bcm63xxpart.c mtd: bcm63xxpart: use nvram for PSI size 2013-08-05 18:59:34 +01:00
cmdlinepart.c
ftl.c
inftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
inftlmount.c
Kconfig mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
Makefile mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
mtd_blkdevs.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
mtdblock.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdblock_ro.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdchar.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdconcat.c
mtdcore.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdcore.h mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
mtdoops.c
mtdpart.c mtd: set the ecc step size for master/slave mtd_info 2013-08-30 21:38:02 +01:00
mtdsuper.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdswap.c mtd: mtdswap: replace strict_strtoul() with kstrtoul() 2013-08-30 21:52:51 +01:00
nftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
nftlmount.c
ofpart.c mtd: ofpart: use for_each_child_of_node() macro 2013-08-30 21:52:57 +01:00
redboot.c
rfd_ftl.c
sm_ftl.c mtd: sm_ftl: Staticize local symbols 2013-08-30 21:51:25 +01:00
sm_ftl.h
ssfdc.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00