linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/4] auxdisplay: hd44780: Fix memory leak on ->remove()
@ 2019-03-12 13:18 Andy Shevchenko
  2019-03-12 13:18 ` [PATCH v1 2/4] auxdisplay: charlcd: Introduce charlcd_free() helper Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andy Shevchenko @ 2019-03-12 13:18 UTC (permalink / raw)
  To: Miguel Ojeda Sandonis, Willy Tarreau, linux-kernel
  Cc: Andy Shevchenko, Geert Uytterhoeven

We have to free on ->remove() the allocated resources on ->probe().

Fixes: d47d88361fee ("auxdisplay: Add HD44780 Character LCD support")
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/auxdisplay/hd44780.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c
index 9ad93ea42fdc..3cde351fb5c9 100644
--- a/drivers/auxdisplay/hd44780.c
+++ b/drivers/auxdisplay/hd44780.c
@@ -280,6 +280,8 @@ static int hd44780_remove(struct platform_device *pdev)
 	struct charlcd *lcd = platform_get_drvdata(pdev);
 
 	charlcd_unregister(lcd);
+
+	kfree(lcd);
 	return 0;
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-12 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 13:18 [PATCH v1 1/4] auxdisplay: hd44780: Fix memory leak on ->remove() Andy Shevchenko
2019-03-12 13:18 ` [PATCH v1 2/4] auxdisplay: charlcd: Introduce charlcd_free() helper Andy Shevchenko
2019-03-12 13:18 ` [PATCH v1 3/4] auxdisplay: panel: Convert to use charlcd_free() Andy Shevchenko
2019-03-12 13:18 ` [PATCH v1 4/4] auxdisplay: hd44780: " Andy Shevchenko
2019-03-12 13:47 ` [PATCH v1 1/4] auxdisplay: hd44780: Fix memory leak on ->remove() Geert Uytterhoeven
2019-03-12 14:40   ` Andy Shevchenko
2019-03-12 15:04     ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).