linux/drivers/mtd/devices
Dan Carpenter 2382960793 mtd: docg3: off by one in doc_register_sysfs()
Smatch found a bug in the error handling:

	drivers/mtd/devices/docg3.c:1634 doc_register_sysfs()
	error: buffer overflow 'doc_sys_attrs' 4 <= 4

The problem is that if the very last device_create_file() fails, then we
are beyond the end of the array.  Actually, any time i == 3 then there
is a problem.  We can fix this an simplify the code at the same time by
moving the !ret conditions out of the for loops and using a goto
instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2015-10-26 11:45:30 -07:00
..
bcm47xxsflash.c mtd: devices: bcm47xxflash: show parent device in sysfs 2015-10-13 09:21:14 -07:00
bcm47xxsflash.h mtd: bcm47xxsflash: implement ChipCommon R/W ops 2013-08-05 18:20:32 +01:00
block2mtd.c writeback: separate out include/linux/backing-dev-defs.h 2015-06-02 08:33:34 -06:00
docg3.c mtd: docg3: off by one in doc_register_sysfs() 2015-10-26 11:45:30 -07:00
docg3.h
Kconfig mtd: powernv: Add powernv flash MTD abstraction driver 2015-06-11 13:23:30 +10:00
lart.c
m25p80.c mtd: spi-nor: Zap unneeded write_enable from write_reg 2015-09-11 16:04:55 -07:00
Makefile mtd: powernv: Add powernv flash MTD abstraction driver 2015-06-11 13:23:30 +10:00
ms02-nv.c mtd: ms02-nv: remove superfluous name cast 2014-01-03 11:22:09 -08:00
ms02-nv.h
mtd_dataflash.c mtd: devices: mtd_dataflash: drop owner assignment 2015-10-13 09:21:15 -07:00
mtdram.c mtd: mtdram: check offs and len in mtdram->erase 2015-10-19 18:08:33 -07:00
phram.c mtd: phram: fix asm/io.h include usage 2014-10-22 01:59:30 -07:00
pmc551.c mtd: delete unnecessary checks before two function calls 2014-11-25 22:44:10 -08:00
powernv_flash.c mtd: powernv: Add powernv flash MTD abstraction driver 2015-06-11 13:23:30 +10:00
serial_flash_cmds.h mtd: st_spi_fsm: begin using spi-nor.h opcodes 2014-04-14 11:23:01 -07:00
slram.c arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
spear_smi.c mtd: devices: spear_smi: show parent device in sysfs 2015-10-13 09:21:15 -07:00
sst25l.c mtd: devices: sst251: show parent device in sysfs 2015-10-13 09:21:16 -07:00
st_spi_fsm.c mtd: st_spi_fsm: Fix [-Wsign-compare] build warning 2015-01-12 21:08:10 -08:00