linux/drivers/auxdisplay
Geert Uytterhoeven a1d6a60ee0 auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string
[ Upstream commit afcb5a811f ]

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: 0cad855fbd ("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>
2021-11-18 14:04:24 +01:00
..
arm-charlcd.c auxdisplay: Replace HTTP links with HTTPS ones 2020-08-08 16:10:03 +02:00
cfag12864b.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
cfag12864bfb.c auxdisplay: constify fb ops 2019-12-11 12:31:39 +02:00
charlcd.c auxdisplay: charlcd: Reuse hex_to_bin() instead of custom code 2020-05-29 23:33:50 +02:00
charlcd.h auxdisplay: charlcd: add include guard to charlcd.h 2019-08-08 19:59:50 +02:00
hd44780.c auxdisplay: charlcd: move charlcd.h to drivers/auxdisplay 2019-08-08 19:59:17 +02:00
ht16k33.c auxdisplay: ht16k33: Fix refresh rate handling 2021-03-04 11:38:00 +01:00
img-ascii-lcd.c auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string 2021-11-18 14:04:24 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ks0108.c auxdisplay: Replace licenses with SPDX identifiers 2018-04-12 19:02:45 +02:00
Makefile auxdisplay: deconfuse configuration 2019-03-17 08:48:33 +01:00
panel.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00