auxdisplay: hd44780: Fix oops on module unloading
authorLars Poeschel <poeschel@lemonage.de>
Wed, 14 Jul 2021 11:02:28 +0000 (13:02 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 16 Jul 2021 05:42:27 +0000 (07:42 +0200)
Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/lkml/CAHp75VfKyqy+vM0XkP9Yb+znGOTVT4zYCRY3A3nQ7C3WNUVN0g@mail.gmail.com/
Reported-By: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
[added Link, Fixes, Cc stable tags, edited message]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
drivers/auxdisplay/hd44780.c

index 2e5e7c9939334750e9239c37ba7f3f0a66b8395a..8b2a0eb3f32a48a8aef0bbc73fe5d6bf62400c76 100644 (file)
@@ -323,8 +323,8 @@ static int hd44780_remove(struct platform_device *pdev)
 {
        struct charlcd *lcd = platform_get_drvdata(pdev);
 
-       kfree(lcd->drvdata);
        charlcd_unregister(lcd);
+       kfree(lcd->drvdata);
 
        kfree(lcd);
        return 0;