]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/auxdisplay-hd44780-fix-memory-leak-on-remove.patch
autosel patches for 3.18
[thirdparty/kernel/stable-queue.git] / queue-5.0 / auxdisplay-hd44780-fix-memory-leak-on-remove.patch
1 From 354b64ac73aa1b13774169e87a08b0e3d2fc8a55 Mon Sep 17 00:00:00 2001
2 From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 Date: Tue, 12 Mar 2019 16:44:28 +0200
4 Subject: auxdisplay: hd44780: Fix memory leak on ->remove()
5
6 [ Upstream commit 41c8d0adf3c4df1867d98cee4a2c4531352a33ad ]
7
8 We have to free on ->remove() the allocated resources on ->probe().
9
10 Fixes: d47d88361fee ("auxdisplay: Add HD44780 Character LCD support")
11 Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
12 Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
13 Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 drivers/auxdisplay/hd44780.c | 2 ++
17 1 file changed, 2 insertions(+)
18
19 diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c
20 index 9ad93ea42fdc..3cde351fb5c9 100644
21 --- a/drivers/auxdisplay/hd44780.c
22 +++ b/drivers/auxdisplay/hd44780.c
23 @@ -280,6 +280,8 @@ static int hd44780_remove(struct platform_device *pdev)
24 struct charlcd *lcd = platform_get_drvdata(pdev);
25
26 charlcd_unregister(lcd);
27 +
28 + kfree(lcd);
29 return 0;
30 }
31
32 --
33 2.19.1
34