Re: [PATCH v3] auxdisplay: hd44780: Fix a potential memory leak in hd44780.c

From: Andy Shevchenko
Date: Wed Feb 26 2025 - 08:28:05 EST


On Wed, Feb 26, 2025 at 06:12:13PM +0800, Haoxiang Li wrote:
> At the 'fail2' label in hd44780_probe(), the 'lcd' variable is
> freed via kfree(), but this does not actually release the memory
> allocated by charlcd_alloc(), as that memory is a container for lcd.
> As a result, a memory leak occurs. Replace kfree() with charlcd_free()
> to fix a potential memory leak.
> Same replacement is done in hd44780_remove().

The v2 was already applied.

--
With Best Regards,
Andy Shevchenko