From: Andy Shevchenko Date: Tue, 12 Mar 2019 14:44:28 +0000 (+0200) Subject: auxdisplay: hd44780: Fix memory leak on ->remove() X-Git-Tag: v4.19.36~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbba1f554b4f0e32ed96fe37ff1e27eba74eabde;p=thirdparty%2Fkernel%2Fstable.git auxdisplay: hd44780: Fix memory leak on ->remove() [ Upstream commit 41c8d0adf3c4df1867d98cee4a2c4531352a33ad ] We have to free on ->remove() the allocated resources on ->probe(). Fixes: d47d88361fee ("auxdisplay: Add HD44780 Character LCD support") Reviewed-by: Geert Uytterhoeven Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda Signed-off-by: Sasha Levin --- diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index f1a42f0f1ded6..df3da49ff9e88 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -299,6 +299,8 @@ static int hd44780_remove(struct platform_device *pdev) struct charlcd *lcd = platform_get_drvdata(pdev); charlcd_unregister(lcd); + + kfree(lcd); return 0; }