2019-07-08 17:10:27

by Zheng Bin

[permalink] [raw]
Subject: [PATCH] auxdisplay: panel: need to delete scan_timer when misc_register fails in panel_attach

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 <[email protected]>
Signed-off-by: zhengbin <[email protected]>
---
drivers/auxdisplay/panel.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index e06de63..e6bd727 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -1617,6 +1617,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:
--
2.7.4


2019-08-08 18:20:32

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] auxdisplay: panel: need to delete scan_timer when misc_register fails in panel_attach

On Mon, Jul 8, 2019 at 2:37 PM zhengbin <[email protected]> wrote:
>
> 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 <[email protected]>
> Signed-off-by: zhengbin <[email protected]>

Picked it up, thanks!

Cheers,
Miguel