All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature
@ 2022-02-23 15:47 Andy Shevchenko
  2022-02-23 15:47 ` [PATCH v1 2/3] auxdisplay: lcd2s: Fix memory leak in ->remove() Andy Shevchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Andy Shevchenko @ 2022-02-23 15:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Miguel Ojeda, Andy Shevchenko, Lars Poeschel

It seems that the lcd2s_redefine_char() has never been properly
tested. The buffer is filled by DEF_CUSTOM_CHAR command followed
by the character number (from 0 to 7), but immediately after that
these bytes are got rewritten by the decoded hex stream.

Fix the index to fill the buffer after the command and number.

Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display")
Cc: Lars Poeschel <poeschel@lemonage.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/auxdisplay/lcd2s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/auxdisplay/lcd2s.c b/drivers/auxdisplay/lcd2s.c
index 38ba08628ccb..ea9d75ad4f16 100644
--- a/drivers/auxdisplay/lcd2s.c
+++ b/drivers/auxdisplay/lcd2s.c
@@ -238,7 +238,7 @@ static int lcd2s_redefine_char(struct charlcd *lcd, char *esc)
 	if (buf[1] > 7)
 		return 1;
 
-	i = 0;
+	i = 2;
 	shift = 0;
 	value = 0;
 	while (*esc && i < LCD2S_CHARACTER_SIZE + 2) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-03-03 11:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 15:47 [PATCH v1 1/3] auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature Andy Shevchenko
2022-02-23 15:47 ` [PATCH v1 2/3] auxdisplay: lcd2s: Fix memory leak in ->remove() Andy Shevchenko
2022-03-03  1:19   ` Miguel Ojeda
2022-02-23 15:47 ` [PATCH v1 3/3] auxdisplay: lcd2s: Use proper API to free the instance of charlcd object Andy Shevchenko
2022-03-03  1:19   ` Miguel Ojeda
2022-03-02 15:47 ` [PATCH v1 1/3] auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature Andy Shevchenko
2022-03-02 16:12 ` Geert Uytterhoeven
2022-03-03  1:18 ` Miguel Ojeda
2022-03-03 10:46   ` Miguel Ojeda
2022-03-03 11:02     ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.