]> www.infradead.org Git - mtd-utils.git/commit
mtd-utils: mtd_debug: check amount of data read.
authorMichal Suchanek <hramrach@gmail.com>
Mon, 27 Jul 2015 13:47:10 +0000 (15:47 +0200)
committerRichard Weinberger <richard@nod.at>
Thu, 25 Aug 2016 13:31:35 +0000 (15:31 +0200)
commita2d188795599846bc8f085418467b794881e7209
tree4e03dfdc42053ed79aa8d0170aac0bf54c0f6e00
parent76c64d6ca9e9258b74ec13d13496eb7ca872a288
mtd-utils: mtd_debug: check amount of data read.

The kernel refuses to read more data from a MTD device than the device
size. However, mtd_debug does not check the amount of data read as
returned by read(2) and assumes the requested amount is always read when
there is no error. Reading 8M data from a 4M flash chip results in 8M
file containing the flash data at the start.

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
misc-utils/mtd_debug.c