]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
auxdisplay: hd44780: Fix memory leak on ->remove()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 12 Mar 2019 14:44:28 +0000 (16:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:15:00 +0000 (09:15 +0200)
[ 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>
drivers/auxdisplay/hd44780.c

index 036eec40428943b7d2c4a32b0db77de40a48ef54..2d927feb3db4f5069c071023dd16725bdba36a6b 100644 (file)
@@ -302,6 +302,8 @@ static int hd44780_remove(struct platform_device *pdev)
        struct charlcd *lcd = platform_get_drvdata(pdev);
 
        charlcd_unregister(lcd);
+
+       kfree(lcd);
        return 0;
 }