android_kernel_motorola_sm6375/drivers/mtd
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Wang YanQing d3f1b113a5 ubi: Fix return value overwrite issue in try_write_vid_and_data()
commit 31a149d5c13c4cbcf97de3435817263a2d8c9d6e upstream.

The commit 2d78aee426 ("UBI: simplify LEB write and atomic LEB change code")
adds helper function, try_write_vid_and_data(), to simplify the code, but this
helper function has bug, it will return 0 (success) when ubi_io_write_vid_hdr()
or the ubi_io_write_data() return error number (-EIO, etc), because the return
value of ubi_wl_put_peb() will overwrite the original return value.

This issue will cause unexpected data loss issue, because the caller of this
function and UBIFS willn't know the data is lost.

Fixes: 2d78aee426 ("UBI: simplify LEB write and atomic LEB change code")
Cc: stable@vger.kernel.org
Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:35:34 +02:00
..
chips mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N 2022-06-14 18:12:03 +02:00
devices mtd: devices: docg3: check the return value of devm_ioremap() in the probe 2022-10-26 13:22:37 +02:00
hyperbus
lpddr mtd: lpddr2_nvm: Fix possible null-ptr-deref 2023-01-18 11:41:03 +01:00
maps mtd: maps: pxa2xx-flash: fix memory leak in probe 2023-01-18 11:41:05 +01:00
nand mtd: rawnand: stm32_fmc2: remove unsupported EDO mode 2023-04-20 12:07:36 +02:00
parsers mtd: partitions: Fix refcount leak in parse_redboot_of 2022-08-25 11:17:51 +02:00
spi-nor mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type() 2023-01-18 11:41:49 +01:00
tests
ubi ubi: Fix return value overwrite issue in try_write_vid_and_data() 2023-05-17 11:35:34 +02:00
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c mtdblock: tolerate corrected bit-flips 2023-04-20 12:07:35 +02:00
mtdblock_ro.c
mtdchar.c
mtdconcat.c
mtdcore.c mtd: Fix device name leak when register device failed in add_mtd_device() 2023-01-18 11:41:02 +01:00
mtdcore.h
mtdoops.c
mtdpart.c
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
rfd_ftl.c
sm_ftl.c mtd: sm_ftl: Fix deadlock caused by cancel_work_sync in sm_release 2022-08-25 11:17:51 +02:00
sm_ftl.h
ssfdc.c