Variable "lcd" allocated by charlcd_alloc() should be released by charlcd_free(). The following patch changed kfree(lcd) to charlcd_free(lcd) to fix an API misuse.
Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li haoxiang_li2024@163.com --- drivers/auxdisplay/hd44780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index 0526f0d90a79..a1729196bc82 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -313,7 +313,7 @@ static int hd44780_probe(struct platform_device *pdev) fail3: kfree(hd); fail2: - kfree(lcd); + charlcd_free(lcd); fail1: kfree(hdc); return ret;
Hi Haoxiang,
On Mon, 24 Feb 2025 at 10:39, Haoxiang Li haoxiang_li2024@163.com wrote:
Variable "lcd" allocated by charlcd_alloc() should be released by charlcd_free(). The following patch changed kfree(lcd) to charlcd_free(lcd) to fix an API misuse.
Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li haoxiang_li2024@163.com
Thanks for your patch!
--- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -313,7 +313,7 @@ static int hd44780_probe(struct platform_device *pdev) fail3: kfree(hd); fail2:
kfree(lcd);
charlcd_free(lcd);
fail1: kfree(hdc); return ret;
LGTM, but please make a similar change to hd44780_remove().
Gr{oetje,eeting}s,
Geert
linux-stable-mirror@lists.linaro.org