OpenCloudOS-Kernel/arch/xtensa/platforms/iss
Yi Yang b011946d03 xtensa/simdisk: fix proc_read_simdisk()
The commit a69755b187 ("xtensa simdisk: switch to proc_create_data()")
split read operation into two parts, first retrieving the path when it's
non-null and second retrieving the trailing '\n'. However when the path
is non-null the first simple_read_from_buffer updates ppos, and the
second simple_read_from_buffer returns 0 if ppos is greater than 1 (i.e.
almost always). As a result reading from that proc file is almost always
empty.

Fix it by making a temporary copy of the path with the trailing '\n' and
using simple_read_from_buffer on that copy.

Cc: stable@vger.kernel.org
Fixes: a69755b187 ("xtensa simdisk: switch to proc_create_data()")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2022-05-11 02:15:38 -07:00
..
include/platform xtensa: ISS: add GDBIO implementation to semihosting interface 2021-04-04 15:39:04 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
console.c arch: xtensa: platforms: Fix deadlock in rs_close() 2022-04-13 03:36:34 -07:00
network.c xtensa: iss: extract and constify network callbacks 2022-05-01 19:51:20 -07:00
setup.c kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
simdisk.c xtensa/simdisk: fix proc_read_simdisk() 2022-05-11 02:15:38 -07:00