auxdisplay: panel: need to delete scan_timer when misc_register fails in panel_attach
authorzhengbin <zhengbin13@huawei.com>
Mon, 8 Jul 2019 12:42:18 +0000 (20:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:20:43 +0000 (10:20 +0200)
[ Upstream commit b33d567560c1aadf3033290d74d4fd67af47aa61 ]

In panel_attach, if misc_register fails, we need to delete scan_timer,
which was setup in keypad_init->init_scan_timer.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/auxdisplay/panel.c

index 6911acd896d935946b3c805d07c88bc03bf41918..e30953ceb7dfd9c28cf7c08137f9cc8c85457b2b 100644 (file)
@@ -1622,6 +1622,8 @@ static void panel_attach(struct parport *port)
        return;
 
 err_lcd_unreg:
+       if (scan_timer.function)
+               del_timer_sync(&scan_timer);
        if (lcd.enabled)
                charlcd_unregister(lcd.charlcd);
 err_unreg_device: