mirror of
https://github.com/openwrt/openwrt.git
synced 2026-07-20 16:11:59 +04:00
2f809f9cff
Two ignored return values in mtd_write_buffer() caused silent failures: - lseek() return value was ignored. A failed seek (e.g. EBADF, ESPIPE) followed by write() would silently write at the wrong offset. - write() return value was ignored, silently discarding write errors. This could lead to data corruption on the MTD device without any indication. Check both return values, report errors to stderr and return -1 on failure. Signed-off-by: Anna Kiri <bredcorn@gmail.com> Link: https://github.com/openwrt/openwrt/pull/23552 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>