]> asedeno.scripts.mit.edu Git - linux.git/commit
mtd: spi-nor: Fix retlen handling in sst_write()
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 25 Oct 2019 07:36:16 +0000 (10:36 +0300)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 1 Nov 2019 08:20:44 +0000 (10:20 +0200)
commit4b3745361cc558e046c7c80826740af2fff30954
tree3e2050f26c6a6361c93a92a9d16cabd9706cdf8c
parent70d2c6dcf8cc655dabab7700f91b194e8cb8a87c
mtd: spi-nor: Fix retlen handling in sst_write()

In case the write of the first byte failed, retlen was incorrectly
incremented to *retlen += actual; on the exit path. retlen should be
incremented when actual data was written to the flash.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
drivers/mtd/spi-nor/spi-nor.c