auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string
stable inclusion from stable-5.10.80 commit a1d6a60ee00ceed18001fec3e6cbb9bc62b8b98d bugzilla: 185821 https://gitee.com/openeuler/kernel/issues/I4L7CG Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a1d6a60ee00ceed18001fec3e6cbb9bc62b8b98d -------------------------------- [ Upstream commit afcb5a81 ] While writing an empty string to a device attribute is a no-op, and thus does not need explicit safeguards, the user can still write a single newline to an attribute file: echo > .../message If that happens, img_ascii_lcd_display() trims the newline, yielding an empty string, and causing an infinite loop in img_ascii_lcd_scroll(). Fix this by adding a check for empty strings. Clear the display in case one is encountered. Fixes: 0cad855f ("auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays") Signed-off-by:Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Chen Jun <chenjun102@huawei.com> Reviewed-by:
Weilong Chen <chenweilong@huawei.com> Acked-by:
Weilong Chen <chenweilong@huawei.com> Signed-off-by:
Chen Jun <chenjun102@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment