summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-03-12 16:44:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-20 09:15:55 +0200
commitcbba1f554b4f0e32ed96fe37ff1e27eba74eabde (patch)
treebee596f0bfe0232d5258e21adf69165121264df9
parent317e716a8ad99f367feaf11d388dd597f832b3b1 (diff)
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 <geert+renesas@glider.be> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/auxdisplay/hd44780.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c
index f1a42f0f1ded..df3da49ff9e8 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;
}