Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string
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: 0cad855 ("auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays") Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
- Loading branch information