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)
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Sun, 17 Mar 2019 07:48:04 +0000 (08:48 +0100)
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>
drivers/auxdisplay/hd44780.c

index 9ad93ea..3cde351 100644 (file)
@@ -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;
 }