summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPengpeng Hou <pengpeng@iscas.ac.cn>2026-06-15 13:58:50 +0800
committerAndreas Larsson <andreas@gaisler.com>2026-06-15 10:06:35 +0200
commit7eb475e8a738ee6fd1260aa59ddccb610fdd4300 (patch)
tree49632f33ac235db1540f153c357144f8a955ade8 /include/linux
parent2416b30ec23fd23126b4747994c00d926d438d6f (diff)
sparc: led: avoid trimming a newline from empty writes
led_proc_write() duplicates up to LED_MAX_LENGTH bytes with memdup_user_nul() and then unconditionally inspects buf[count - 1] to strip a trailing newline. A zero-length write therefore reads one byte before the duplicated buffer. The previous version rejected empty writes, but empty input already falls through to the existing default case and turns the LED off like any other unrecognized string. Preserve that behavior and only skip the newline trim when there is no input byte to inspect. Fixes: ee1858d3122d ("[SPARC]: Add sun4m LED driver.") Suggested-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions