Skip to content

Commit

Permalink
Staging: panel: fix oops on panel_cleanup_module
Browse files Browse the repository at this point in the history
Check for null pardevice (not registered, ej: panel never attached,
inexistent parport, etc. )  before calling parport_release,
parport_unregister_device, and related funcs on module release.

Signed-off-by: Costantino Leandro <lcostantino@gmail.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Costantino Leandro authored and Greg Kroah-Hartman committed Feb 27, 2009
1 parent 096c55d commit 5789813
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions drivers/staging/panel/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2164,19 +2164,20 @@ static void __exit panel_cleanup_module(void)
if (scan_timer.function != NULL)
del_timer(&scan_timer);

if (keypad_enabled)
misc_deregister(&keypad_dev);
if (pprt != NULL) {
if (keypad_enabled)
misc_deregister(&keypad_dev);

if (lcd_enabled) {
panel_lcd_print("\x0cLCD driver " PANEL_VERSION
"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
misc_deregister(&lcd_dev);
}

if (lcd_enabled) {
panel_lcd_print("\x0cLCD driver " PANEL_VERSION
"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
misc_deregister(&lcd_dev);
/* TODO: free all input signals */
parport_release(pprt);
parport_unregister_device(pprt);
}

/* TODO: free all input signals */

parport_release(pprt);
parport_unregister_device(pprt);
parport_unregister_driver(&panel_driver);
}

Expand Down

0 comments on commit 5789813

Please sign in to comment.